home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 25 / Cream of the Crop 25.iso / program / ny_src.zip / SECOND.CPP < prev    next >
C/C++ Source or Header  |  1997-04-22  |  119KB  |  4,580 lines

  1. // include the header
  2. #include "NY2008.h"
  3.  
  4. // include prototypes for fights
  5. #include "fights.h"
  6.  
  7. extern unsigned _stklen;
  8. extern struct ffblk fff;
  9.  
  10. extern struct {
  11.     int        first_enemy[LEVELS],
  12.             last_enemy[LEVELS];
  13.     } enemy_idx;
  14.  
  15. extern char oneframe;
  16. extern int noevents;
  17. extern int time_slice_value;
  18. extern int no_rip_m;
  19.  
  20. extern int dobad;
  21.  
  22. extern tIBInfo IBBSInfo;
  23. extern int ibbs;
  24. extern int ibbs_send_nodelist;
  25. extern int ibbs_maint_i;
  26. extern int ibbs_maint_o;
  27. extern int ibbs_operator;
  28. extern int ibbs_game_num;
  29.  
  30.  
  31. // price arrays
  32. extern long gun_price[A_BOMB+1];
  33. extern int     drug_price[HEROIN+1];
  34. extern int no_kernel;
  35. extern int ibbs;
  36. extern int ibbs_operator;
  37. extern int ibbs_game_num;
  38.  
  39. // Declare global variables
  40. extern int nCurrentUserNumber,max_fights,max_drug_hits,condom_price,delete_after;
  41. extern int bank_interest;
  42. extern char ansi_name[61],ascii_name[61];
  43. extern int do_scr_files;
  44. extern user_rec cur_user;
  45. extern enemy enemy_rec;
  46. extern int registered;
  47. extern char uname[36];
  48. extern char rec_credit[36];
  49. extern int do_maint;
  50. extern char str[15];
  51. extern int expert;
  52. extern int rip;
  53. extern char maint_exec[61];
  54. extern char *t_buffer;
  55. char *t_buffer1;
  56. char savelevel=0;
  57. extern int single_node;
  58. extern char *ver;
  59. extern char *verinfo;
  60. extern int gamedisk,flagdisk;
  61. extern char gamedir[MAXDIR],flagdir[MAXDIR];
  62. extern char c_dir_g;
  63. extern int clean_mode;
  64.  
  65. extern int busted_ch_bank;
  66. extern int busted_ch_food;
  67. extern int busted_ch_rape;
  68. extern int busted_ch_beggar;
  69. extern int busted_ch_car;
  70. extern int busted_ch_school;
  71. extern int busted_ch_window;
  72. extern int busted_ch_poison;
  73. extern int busted_ch_bomb;
  74. extern int success_ch_bank;
  75. extern int success_ch_food;
  76. extern int success_ch_rape;
  77. extern int success_ch_beggar;
  78. extern int success_ch_car;
  79. extern int success_ch_school;
  80. extern int success_ch_window;
  81. extern int success_ch_poison;
  82. extern int success_ch_bomb;
  83.  
  84. extern int check_o_nodes;
  85. extern int no_slices;
  86.  
  87.  
  88.  
  89. void
  90. get_line(char beg[],char line[], char ovr[],int wrap)
  91. {
  92.   char key;
  93.   int cnt,cnt2;
  94.   int intval;
  95.  
  96.   cnt=0;
  97.   cnt2=0;
  98.   cnt=strlen(beg);
  99.   od_printf("`bright green`%s",beg);
  100.  
  101.   sprintf(line,"%s",beg);
  102.  
  103.   ovr[0]=0;
  104.  
  105.   do {
  106.     key=od_get_key(TRUE);
  107.     if (key!='\b') {
  108.       if (cnt==0 && key=='/') {
  109.     ny_line(331,0,0);
  110.     //Command (S A C=continue)
  111.     key=od_get_answer("SAC");
  112.     od_putch(key);
  113.     if (key=='S') {
  114.       line[0]='/';
  115.       line[1]='S';
  116.       line[2]=0;
  117.       od_printf("\n\r");
  118.       return;
  119.     } else if (key=='A') {
  120.       line[0]='/';
  121.       line[1]='A';
  122.       line[2]=0;
  123.       od_printf("\n\r");
  124.       return;
  125.     } else {
  126.       cnt=0;
  127.       od_printf("\r                          \r`bright green`");
  128.     }
  129.       } else if (key!='\n' && key!='\r') {
  130.     if(wrap==TRUE || cnt<77) {
  131.       line[cnt]=key;
  132.       cnt++;
  133.       od_putch(key);
  134.     } else {
  135.       line[cnt]=key;
  136.       od_putch(key);
  137.       od_putch('\b');
  138.     }
  139.       } else {
  140.     od_printf("\n\r");
  141.     line[cnt]=0;
  142.     cnt=0;
  143.       }
  144.     } else {
  145.       if (cnt>0) cnt--;
  146.       od_printf("\b \b");
  147.     }
  148.  
  149.   } while (cnt<78 && key!='\n' && key!='\r');
  150.  
  151.   if (cnt>=78) {
  152.     while (line[cnt]!=' ' && cnt>0) {
  153.       cnt--;
  154.       od_printf("\b");
  155.     }
  156.     if (cnt==0) {
  157.       cnt=78;
  158.     } else {
  159.       cnt++;
  160.       od_clr_line();
  161.     }
  162.     od_printf("\n\r");
  163.     while (cnt<78) {
  164.       ovr[cnt2]=line[cnt];
  165.       line[cnt]=0;
  166.       cnt2++;
  167.       cnt++;
  168.     }
  169.     line[78]=0;
  170.     ovr[cnt2]=0;
  171.   }
  172.   if(dobad)
  173.     dobadwords(line);
  174. }
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181. int
  182. askifuser(char handle[25])
  183. {
  184.   char key;
  185.   char numstr[26];
  186.  
  187.  
  188.   ny_line(332,1,0);
  189.   //Did ya mean
  190.   if(!rip)
  191.     ny_disp_emu(handle);
  192.   else
  193.     od_disp_str(ny_un_emu(handle,numstr));
  194.   ny_line(79,0,0);
  195.   //? (Y/N)
  196.  
  197.   key=ny_get_answer("YN");
  198.   if(!rip)
  199.     od_printf("%c\n\r",key);
  200.   else
  201.     od_disp_str("\n\r");
  202.   if (key=='Y')
  203.     return TRUE;
  204.   return FALSE;
  205. }
  206.  
  207.  
  208.  
  209.  
  210.  
  211. void
  212. newz_ops(void)
  213. {
  214.     struct {
  215.         char  tagline[80],
  216.                name[25],
  217.                name2[36];
  218.         int   flag;
  219.         } newzfile;
  220.         // flag settings//
  221.         // 0 - system news
  222.         // 1 - user announcment (name)
  223.         // 2 - user BUSTED (name) for (tagline)
  224.         // 3 - user newz (name)
  225.         // 4 - user kicked ass (name kicked name2's ass)
  226.         // 5 - user had his ass kicked (name was beat by name2)
  227.         // 6 - user announcment (name from name2(cut down to 35 chars))
  228.  
  229.  
  230.     char key,key_s;
  231.     FILE *justfile;
  232.     int cnt;
  233.     long filepos;
  234. //    ffblk ffblk;
  235.     int nonstop=FALSE;
  236.  
  237.     key='T';
  238.  
  239.     ch_game_d();
  240.     if (findfirst("NYNEWS.YES",&fff,0)!=0 || findfirst("NYNEWS.TOD",&fff,0)!=0) {
  241.       justfile=ShareFileOpen("NYNEWS.TOD","r+b");
  242.       fclose(justfile);
  243.       justfile=ShareFileOpen("NYNEWS.YES","r+b");
  244.       fclose(justfile);
  245.     }
  246.  
  247.     if(rip==TRUE && oneframe==FALSE) {
  248.       od_disp_str("\n\r");
  249.       od_send_file("FRAME.RIP");
  250.     }
  251.  
  252.     do {
  253.  
  254.       if(rip) {
  255.         od_disp_str("\n\r!|e|#|#|#\n\r");
  256.         od_send_file("FRAME3.RIP");
  257.       } else {
  258.         od_printf("\n\r\n");
  259.         ny_clr_scr();
  260.       }
  261.  
  262.       cnt=4;
  263.       ny_send_menu(NEWZ,"");
  264.       //The New York Times
  265.       //-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  266.       ny_kernel();
  267.  
  268.       if (key=='T') justfile=ShareFileOpen("NYNEWS.TOD","rb");
  269.       else justfile=ShareFileOpen("NYNEWS.YES","rb");
  270.  
  271.       if(filelength(fileno(justfile))<sizeof(newzfile) && key=='T') {
  272.         ny_line(413,1,1);
  273.         fclose(justfile);
  274.         justfile=ShareFileOpen("NYNEWS.TOD","wb");
  275.         fclose(justfile);
  276.       } else if(filelength(fileno(justfile))<sizeof(newzfile)) {
  277.         ny_line(414,1,1);
  278.         fclose(justfile);
  279.         justfile=ShareFileOpen("NYNEWS.YES","wb");
  280.         fclose(justfile);
  281.       } else {
  282.         while (ny_fread(&newzfile,sizeof(newzfile),1,justfile)==1) {
  283.           cnt+=2;
  284.           if (newzfile.flag==0) {
  285.         ny_disp_emu("\n\r`@");
  286.         ny_disp_emu(newzfile.tagline);
  287.         od_printf("\n\r");
  288.           } else if (newzfile.flag==1) {
  289.         ny_disp_emu("\n\r`2");
  290.         ny_disp_emu(newzfile.tagline);
  291.         ny_disp_emu("\n\r`0                                                     ");
  292.         ny_disp_emu(newzfile.name);
  293.         od_printf("\n\r");
  294.         cnt++;
  295.           } else if (newzfile.flag==6) {
  296.         ny_disp_emu("\n\r`2");
  297.         ny_disp_emu(newzfile.tagline);
  298.         ny_disp_emu("\n\r`0            ");
  299.         ny_disp_emu(newzfile.name);
  300.         ny_disp_emu(" `2from `0");
  301.         ny_disp_emu(newzfile.name2);
  302.         od_printf("\n\r");
  303.         cnt++;
  304.           } else if (newzfile.flag==2) {
  305.         ny_disp_emu("\n\r`0");
  306.         ny_disp_emu(newzfile.name);
  307.         ny_disp_emu("`4 got `@BUSTED`4 today for `@");
  308.         ny_disp_emu(newzfile.tagline);
  309.         od_printf("\n\r");
  310.           } else if (newzfile.flag==3) {
  311.         ny_disp_emu("\n\r`0");
  312.         ny_disp_emu(newzfile.name);
  313.         ny_disp_emu("`4 ");
  314.         ny_disp_emu(newzfile.tagline);
  315.         od_printf("\n\r");
  316.           } else if (newzfile.flag==4) {
  317.         ny_disp_emu("\n\r`0");
  318.         ny_disp_emu(newzfile.name);
  319.         ny_disp_emu("`9 beat up `0");
  320.         ny_disp_emu(newzfile.name2);
  321.         ny_disp_emu("\n\r`3\"");
  322.         ny_disp_emu(newzfile.tagline);
  323.         ny_disp_emu("`3\" `@S`4creams `0");
  324.         ny_disp_emu(newzfile.name);
  325.         od_printf("\n\r");
  326.         cnt++;
  327.           } else if (newzfile.flag==5) {
  328.         ny_disp_emu("\n\r`0");
  329.         ny_disp_emu(newzfile.name);
  330.         ny_disp_emu("`9 was beat up by `0");
  331.         ny_disp_emu(newzfile.name2);
  332.         ny_disp_emu("\n\r`3\"");
  333.         ny_disp_emu(newzfile.tagline);
  334.         ny_disp_emu("`3\" `@W`4hispers `0");
  335.         ny_disp_emu(newzfile.name);
  336.         ny_disp_emu(" `@I`4n `@P`4ain\n\r");
  337.         cnt++;
  338.           }
  339.  
  340.           if (nonstop==FALSE && (cnt+1)>=od_control.user_screen_length) {
  341.         cnt=0;
  342.         filepos=ftell(justfile);
  343.         fclose(justfile);
  344.         ny_disp_emu("`%More (Y/n/=)");
  345.         key_s=ny_get_answer("YN=\n\r");
  346.         od_printf("\r            \r");
  347.         //if(key_s=='\n' || key_s=='\r') key_s='Y';
  348.         //od_putch(key_s);
  349.         if(key_s=='N')
  350.           return;
  351.         else if(key_s=='=')
  352.           nonstop=TRUE;
  353.  
  354. //            WaitForEnter();
  355.  
  356.  
  357.         //od_printf("\n\r");
  358.         if (key=='T') justfile=ShareFileOpen("NYNEWS.TOD","rb");
  359.         else justfile=ShareFileOpen("NYNEWS.YES","rb");
  360.         fseek(justfile,filepos,SEEK_SET);
  361.  
  362.           }
  363.         }
  364.         fclose(justfile);
  365.       }
  366.       if(rip) od_send_file("FRAME2.RIP");
  367.       ny_line(65,1,0);
  368.       //T - Todays Newz Y - Yesterdays Newz [Q] - Quit
  369.  
  370.       key=ny_get_answer("TYQ\n\r");
  371.       if (key=='\n' || key=='\r') key='Q';
  372.       od_putch(key);
  373.     } while (key!='Q');
  374.  
  375. }
  376.  
  377.  
  378.  
  379.  
  380.  
  381. void
  382. news_post(char line[], char name1[], char name2[], int flag)
  383. {
  384.     FILE *justfile;
  385.     char c_dir;
  386.  
  387.     c_dir=c_dir_g;
  388.  
  389.     ch_game_d();
  390.     justfile=ShareFileOpen("NYNEWS.TOD","a+b");
  391.     ny_fwrite(line,80,1,justfile);
  392.     ny_fwrite(name1,25,1,justfile);
  393.     ny_fwrite(name2,36,1,justfile);
  394.     ny_fwrite(&flag,2,1,justfile);
  395.     fclose(justfile);
  396.  
  397.     if(c_dir==1) ch_flag_d();
  398. }
  399.  
  400.  
  401. void
  402. guns_ops(void)
  403. {
  404.     char key,
  405.          s_key;
  406.     unsigned long max;
  407.     weapon choice;
  408.  
  409.     do {
  410.       key = callmenu("BSYLQ?\n\r",ARMS,345,FALSE);
  411.       while (expert>0 && key=='?') {
  412.         expert+=10;
  413.         key=callmenu("BSYLQ?\n\r",ARMS,345,FALSE);
  414.         expert-=10;
  415.       }
  416.  
  417.  
  418.       if (key=='Y') {
  419.         DisplayStats();
  420.         WaitForEnter();
  421.         }
  422.       else if (key=='L') {           // list prices
  423.  
  424.         if(rip) ny_clr_scr();
  425.         ny_line(66,2,2);
  426.         //Here's what i got:
  427.         ny_send_menu(WEAPONS,"",2);
  428.  
  429.         WaitForEnter();
  430.       }
  431.  
  432.       else if (key=='B') {           // buy weapon
  433.  
  434.         if(rip) ny_clr_scr();
  435.         ny_line(67,2,2);
  436.         //Choose yer new weapon:
  437.         ny_send_menu(WEAPONS,"",2);
  438.         ny_line(333,1,0);
  439.         //Which one? You got
  440.         od_printf(D_Num(cur_user.money));
  441.         ny_line(334,0,0);
  442.         //to spend. (A-W, Enter=[Q]=Quit)
  443.  
  444.         s_key=ny_get_answer("ABCDEFGHIJKLMNOPRSTUVWQ\n\r");
  445.         if (s_key=='\n' || s_key=='\r') s_key='Q';
  446.         od_putch(s_key);
  447.         if(!registered && s_key!='Q' && s_key>'J') {
  448.           ny_disp_emu("`%\n\r\nUNREGISTERED!!!\n\r\nCannot do this!!!\n\r");
  449.           WaitForEnter();
  450.           s_key='Q';
  451.         }
  452.         if (s_key!='Q') {
  453.           if (s_key=='A') choice=PEPPER;
  454.           else if (s_key=='B') choice=SHARP_STICK;
  455.           else if (s_key=='C') choice=SCREWDRIVER;
  456.           else if (s_key=='D') choice=KNIFE;
  457.           else if (s_key=='E') choice=HAMMER;
  458.           else if (s_key=='F') choice=CHAIN;
  459.           else if (s_key=='G') choice=LEAD_PIPE;
  460.           else if (s_key=='H') choice=GUN;
  461.           else if (s_key=='I') choice=COLT;
  462.           else if (s_key=='J') choice=RIFLE;
  463.           else if (s_key=='K') choice=ELEPHANT_GUN;
  464.           else if (s_key=='L') choice=LASER_GUN;
  465.           else if (s_key=='M') choice=NAILGUN;
  466.           else if (s_key=='N') choice=SHOTGUN;
  467.           else if (s_key=='O') choice=ASSAULT_RIFLE;
  468.           else if (s_key=='P') choice=MACHINEGUN;
  469.           else if (s_key=='R') choice=PROTON_GUN;
  470.           else if (s_key=='S') choice=GRANADE_LAUNCHER;
  471.           else if (s_key=='T') choice=NEUTRON_PHASER;
  472.           else if (s_key=='U') choice=BLASTER;
  473.           else if (s_key=='V') choice=ULTRASOUND_GUN;
  474.           else if (s_key=='W') {
  475.         choice=A_BOMB;
  476.         if (cur_user.level<20) {
  477.           ny_line(408,2,1);
  478.           if(!rip)
  479.             WaitForEnter();
  480.           else
  481.             od_get_answer("\n\r");
  482.           goto not_old_enuf;
  483.         }
  484.  
  485.         ny_line(68,2,1);
  486.         //If you buy an A-Bomb you will have to fight with hands again, but who want's to
  487.         ny_line(69,0,1);
  488.         //fight if you can finish what you came here for ...
  489.  
  490.         WaitForEnter();
  491.           }
  492.           if (cur_user.arm!=HANDS) {
  493.  
  494.         ny_line(70,2,0);
  495.         //Ya'll heffta sell yer
  496.         print_arm(cur_user.arm);
  497.         ny_line(335,0,0);
  498.         //for
  499.         od_printf(D_Num(gun_price[cur_user.arm]/2));
  500.         ny_line(336,0,0);
  501.         //, OK?(Y/N)
  502.  
  503.         s_key=ny_get_answer("YN");
  504.         if(!rip) od_putch(s_key);
  505.         if (s_key=='Y') {
  506.           money_plus(gun_price[cur_user.arm]/2);
  507.           cur_user.arm=HANDS;
  508.           wrt_sts();
  509.  
  510.           ny_line(71,2,0);
  511.           //Sold
  512.           if(rip)
  513.             od_get_answer("\n\r");
  514.  
  515.           ny_kernel();
  516.  
  517.         } else choice=HANDS;
  518.           }
  519.           if (gun_price[choice]>cur_user.money && choice!=HANDS) {
  520.  
  521.         ny_line(72,2,1);
  522.         //Ya ain't got nuf money bro...
  523.  
  524.         if(!rip)
  525.           WaitForEnter();
  526.         else
  527.           od_get_answer("\n\r");
  528.           } else if (choice!=HANDS) {
  529.  
  530.         ny_line(73,2,0);
  531.         //Buy a
  532.         print_arm(choice);
  533.         ny_line(335,0,0);
  534.         //for
  535.         od_printf(D_Num(gun_price[choice]));
  536.         ny_line(336,0,0);
  537.         //?(Y/N)
  538.  
  539.         s_key=ny_get_answer("YN");
  540.         if(!rip) od_putch(s_key);
  541.         if (s_key=='Y') {
  542.           cur_user.arm=choice;
  543.           money_minus(gun_price[choice]);
  544.           wrt_sts();
  545.  
  546.           ny_line(74,2,0);
  547.           //Ya now got the
  548.           print_arm(choice);
  549.           ny_line(75,0,1);
  550.           //so go destroy something...
  551.  
  552.           if(!rip)
  553.             WaitForEnter();
  554.           else
  555.             od_get_answer("\n\r");
  556.  
  557.         }
  558.           }
  559. not_old_enuf:;
  560.         }
  561.       }
  562.       else if (key=='S') {   // Sell guns
  563.         if(rip) no_rip_m=1;
  564.         if (cur_user.arm==HANDS) {
  565.  
  566.           ny_line(76,2,1);
  567.           //You ain't got nothing to sell!
  568.  
  569.           if(!rip)
  570.         WaitForEnter();
  571.           else
  572.            od_get_answer("\n\r");
  573.         } else {
  574.  
  575.           ny_line(77,2,0);
  576.           //Sell yer
  577.           print_arm(cur_user.arm);
  578.           ny_line(78,0,0);
  579.           //for
  580.           od_printf(D_Num(gun_price[cur_user.arm]/2));
  581.           ny_line(79,0,0);
  582.           //?(Y/N)
  583.  
  584.           s_key=ny_get_answer("YN");
  585.           if(!rip) od_putch(s_key);
  586.           if (s_key=='Y') {
  587.         money_plus(gun_price[cur_user.arm]/2);
  588.         cur_user.arm=HANDS;
  589.         wrt_sts();
  590.         ny_line(71,1,1);
  591.         //Sold
  592.         if(!rip)
  593.           WaitForEnter();
  594.         else
  595.           od_get_answer("\n\r");
  596.           }
  597.         }
  598.       }
  599.     } while (key!='Q');
  600. }
  601.  
  602. void
  603. take_drug(void)
  604. {
  605.   if(rip) no_rip_m=1;
  606.   if (cur_user.drug_hits<=0) {   // check if got some drugs
  607.     ny_line(80,2,1);
  608.     //You got no hits man...
  609.     if(!rip)
  610.       WaitForEnter();
  611.     else
  612.       od_get_answer("\n\r");
  613.   }
  614.   else if (cur_user.drug_high==100) {
  615.     ny_line(81,2,1);
  616.     //Yer already 100% stoned!
  617.     if(!rip)
  618.       WaitForEnter();
  619.     else
  620.       od_get_answer("\n\r");
  621.   }
  622.   else { // ok to take a drug
  623.     ny_line(82,2,1);
  624.     //You take a hit of yer favorite drug...
  625.     if(rip)
  626.       od_get_answer("\n\r");
  627.     cur_user.drug_hits--;       //decrease user hits
  628.     points_raise((unsigned long)(12*(cur_user.drug+1))); //raise points for taking drugs
  629.     cur_user.drug_high+=25;   //25% more high
  630.     if (cur_user.drug_high>100) cur_user.drug_high=100;
  631.     ny_line(83,0,0);
  632.     //You are now
  633.     od_printf("%d",(int)cur_user.drug_high,37);
  634.     ny_line(84,0,1);
  635.     if(rip)
  636.       od_get_answer("\n\r");
  637.     //% high
  638.     wrt_sts();
  639.     if (cur_user.drug>=COKE) {
  640.       cur_user.drug_addiction+=10;
  641.       cur_user.drug_days_since=0;
  642.       wrt_sts();
  643.       if (cur_user.drug_addiction>=100) { //overdosed
  644.     cur_user.drug_addiction=100;
  645.     Die(1);
  646.       }
  647.       ny_line(85,0,1);
  648.       //Yer drug addiction went up by 10%
  649.       if(rip)
  650.     od_get_answer("\n\r");
  651.     }
  652.     if(!rip) WaitForEnter();
  653.   }
  654. }
  655.  
  656.  
  657.  
  658.  
  659.  
  660.  
  661.  
  662. void
  663. healing_ops(void)
  664. {
  665.     char key,
  666.          s_key;
  667.     int  hit_diff,
  668.          howmuch;
  669.     long intval;
  670.  
  671.     /*drug rehab prices for different levels*/
  672.                     /* 0  1   2   3   4   5   6   7   8   9   10  11   12   13   14   15   16   17   18   19   20*/
  673.     //int drug_rehab_price[LEVELS] ={80,110,150,270,360,420,530,620,750,890,950,1100,1410,1730,2050,2600,3700,4800,6310,8130,10000};
  674.  
  675.     do {
  676.       key = callmenu("HDCYQ?\n\r",HEALING,346,FALSE);
  677.       while (expert>0 && key=='?') {
  678.         expert+=10;
  679.         key=callmenu("HDCYQ?\n\r",HEALING,346,FALSE);
  680.         expert-=10;
  681.       }
  682.  
  683.  
  684.       if (key=='Y') {
  685.         DisplayStats();
  686.         WaitForEnter();
  687.       } else if (key=='H') {
  688.         heal_wounds();
  689.       } else if (key=='C') {
  690.         int std_diff;
  691.  
  692.         if (cur_user.std==NONE) {
  693.  
  694.           ny_line(86,2,1);
  695.           //Yer not infected ... (yet) ...
  696.  
  697.           if(!rip)
  698.         WaitForEnter();
  699.           else {
  700.         od_get_answer("\n\r");
  701.         no_rip_m=1;
  702.           }
  703.         } else {
  704.           std_diff=cur_user.std_percent;
  705.           intval=pow(1.6,cur_user.level)*cur_user.std;
  706.  
  707.           ny_line(87,2,0);
  708.           //It costs
  709.           od_printf(D_Num(intval));//%s
  710.           ny_line(88,0,0);
  711.           // to cure 1%
  712.           if(rip)
  713.         od_get_answer("\n\r");
  714.  
  715.           ny_line(89,1,0);
  716.           //You can heal
  717.           od_printf(D_Num(std_diff));//%s
  718.           ny_line(90,0,0);
  719.           //% for
  720.           od_printf(D_Num(std_diff*intval));
  721.           if(rip) {
  722.         od_disp_str("::^M@OK))|#|#|#\n\r");
  723.         od_get_answer("\n\r");
  724.           }
  725.  
  726.           if ((std_diff*intval)>cur_user.money) {
  727.         std_diff=cur_user.money/(intval);
  728.         ny_line(91,1,0);
  729.         //You can only afford to cure
  730.         od_printf("%s`red`%c!",D_Num(std_diff),37);
  731.         if(rip) {
  732.           od_disp_str("::^M@OK))|#|#|#\n\r");
  733.           od_get_answer("\n\r");
  734.         }
  735.           }
  736.           if(rip) {
  737.         od_send_file("input.rip");
  738.           }
  739.  
  740.           ny_line(92,2,0);
  741.           //So how much ya want healed (Enter=[
  742.           od_printf(D_Num(std_diff));
  743.           ny_line(93,0,0);
  744.           //], M=max
  745.           od_printf(D_Num(std_diff));
  746.           ny_disp_emu("`2):");
  747.  
  748.           howmuch=get_val((unsigned long)std_diff,(unsigned long)std_diff);
  749.           cur_user.std_percent-=howmuch;
  750.           money_minus(howmuch * (cur_user.level+1) * cur_user.std);
  751.           if(!rip) {
  752.         ny_disp_emu("\n\r`@");
  753.           } else {
  754.         ny_disp_emu("\n\r!|10");
  755.           }
  756.           od_printf(D_Num(howmuch));
  757.  
  758.           ny_line(94,0,1);
  759.           //% cured!
  760.  
  761.           wrt_sts();
  762.  
  763.           if(!rip)
  764.         WaitForEnter();
  765.           else
  766.         od_get_answer("\n\r");
  767.         }
  768.       }
  769.  
  770.       else if (key=='D') {
  771.         if(rip) no_rip_m=1;
  772.         if (cur_user.drug<COKE || cur_user.drug_addiction==0) {
  773.  
  774.           ny_line(95,2,1);
  775.           //Yer not addicted or anything...
  776.  
  777.           if(!rip)
  778.         WaitForEnter();
  779.           else
  780.         od_get_answer("\n\r");
  781.         } else {
  782.  
  783.          ny_line(96,2,0);
  784.  
  785.          od_printf(D_Num((unsigned long)(500*pow(1.9,cur_user.level))));
  786.          ny_line(97,0,0);
  787.          // for loosing 1/3 of addiction, do it (Y/N)
  788.  
  789.           s_key=ny_get_answer("YN");
  790.           od_putch(s_key);
  791.           if (s_key=='Y') {
  792.         if (cur_user.money<500*pow(1.9,cur_user.level)) {
  793.  
  794.           ny_line(98,2,1);
  795.  
  796. //          od_printf("\n\r\n`bright`You can't afford it!\n\r");
  797.           if(!rip)
  798.             WaitForEnter();
  799.           else
  800.             od_get_answer("\n\r");
  801.         } else {
  802.           money_minus(500*pow(1.9,cur_user.level));
  803.           cur_user.drug_addiction=cur_user.drug_addiction*2/3;
  804.           wrt_sts();
  805.           news_post("was in drug rehab today",cur_user.name,"",3);
  806.  
  807.           ny_line(99,2,1);
  808.  
  809. //          od_printf("\n\r\n`bright green`Y`green`ou feel so much better......\n\r");
  810.           if(!rip)
  811.             WaitForEnter();
  812.           else
  813.             od_get_answer("\n\r");
  814.         }
  815.           }
  816.         }
  817.       }
  818.     } while (key!='Q');
  819. }
  820.  
  821. void
  822. heal_wounds()
  823. {
  824.   long hit_diff;
  825.   unsigned long howmuch;
  826.  
  827.   if (cur_user.hitpoints==cur_user.maxhitpoints) {
  828.  
  829.     ny_line(100,2,1);
  830. //    od_printf("\n\r\n`bright red`Y`red`er not hurt ... (yet) ...\n\r");
  831.  
  832.     if(!rip)
  833.       WaitForEnter();
  834.     else {
  835.       od_get_answer("\n\r");
  836.       no_rip_m=1;
  837.     }
  838.     return;
  839.   }
  840.   hit_diff=cur_user.maxhitpoints-cur_user.hitpoints;
  841.  
  842.   ny_line(101,2,0);
  843.   //od_printf("\n\r\n`bright red`Y`red`ou can heal `bright red`
  844.   od_printf(D_Num(hit_diff));
  845.   ny_line(78,0,0);
  846. //  od_printf(" for `bright red`
  847.   od_printf(D_Num(hit_diff*(long)(cur_user.level/2.0 + 1)));
  848.   if(rip) {
  849.     od_disp_str("::^M@OK))|#|#|#\n\t");
  850.     od_get_answer("\n\r");
  851.   }
  852.  
  853.   if ((long)(hit_diff * (int)(cur_user.level/2.0 + 1))>cur_user.money) {
  854.     hit_diff=cur_user.money/(int)(cur_user.level/2.0 + 1);
  855.     ny_line(102,1,0);
  856.     //od_printf("\n\r`bright red`Y`red`ou can only afford to heal `bright red`
  857.     od_printf(D_Num(hit_diff));
  858.     ny_line(103,0,0);
  859.     if(rip)
  860.       od_get_answer("\n\r");
  861.     //`red` hitpoints!
  862.   }
  863.   if(rip) {
  864.     od_send_file("input.rip");
  865.   }
  866.  
  867.   ny_line(104,2,0);
  868. //  od_printf("\n\r\n`bright green`S`green`o how much ya want healed (`bright blue`Enter`green`=`bright green`[
  869.   od_printf(D_Num(hit_diff));
  870.   ny_line(93,0,0);
  871.   //]`datk geen`, `bright blue`M`green`=max `bright green`%s`green`):",D_Num(hit_diff),str);
  872.   od_printf(D_Num(hit_diff));
  873.   ny_disp_emu("`2):");
  874.  
  875.   howmuch=get_val((unsigned long)hit_diff,(unsigned long)hit_diff);
  876.   cur_user.hitpoints+=howmuch;
  877.   money_minus(howmuch * (int)(cur_user.level/2.0 + 1));
  878.  
  879.   if(!rip)
  880.     ny_disp_emu("\n\r`@");
  881.   else
  882.     od_disp_str("\n\r!|10((*");
  883.   od_printf(D_Num(howmuch));
  884.   ny_line(105,0,1);
  885. //   H`red`itpoints were healed!\n\r",D_Num(howmuch));
  886.  
  887.   wrt_sts();
  888.   if(!rip)
  889.     WaitForEnter();
  890.   else
  891.     od_get_answer("\n\r");
  892.  
  893. }
  894.  
  895.  
  896. void
  897. food_ops(void)
  898. {
  899.     char key,
  900.          s_key;
  901.     long longval,intval;
  902.     int chance;
  903.  
  904.     do {
  905.         key=callmenu("GESYQ?\n\r",FOOD,347,FALSE);
  906.         while (expert>0 && key=='?') {
  907.           expert+=10;
  908.           key=callmenu("GESYQ?\n\r",FOOD,347,FALSE);
  909.           expert-=10;
  910.         }
  911.  
  912.  
  913.         if (key=='Y') {
  914.             DisplayStats();
  915.             WaitForEnter();
  916.         }
  917.         else if (key=='G') {
  918.           if(rip) no_rip_m=1;
  919.           if (cur_user.hunger==0) {
  920.  
  921.             ny_line(106,2,1);
  922. //            od_printf("\n\r\n`bright green`Y`green`er not hungry....\n\r");
  923.  
  924.             if(!rip)
  925.               WaitForEnter();
  926.             else
  927.               od_get_answer("\n\r");
  928.           } else {
  929.             intval=80 + (50*pow(1.4,(double)cur_user.level));
  930.  
  931.             ny_line(107,2,0);
  932.             //od_printf("\n\r\n`bright green`A`green`s you enter a restaurant you look at the prices...`bright green`
  933.             od_printf(D_Num(intval));
  934.             ny_line(108,0,0);
  935.  
  936.             //`green` ..., do it (`bright green`Y`green`/`bright green`N`green`)",D_Num(intval));
  937.             s_key=ny_get_answer("YN");
  938.             if(!rip) od_putch(s_key);
  939.             if (s_key=='Y') {
  940.               if (cur_user.money<intval) {
  941.  
  942.             ny_line(109,2,1);
  943.  
  944.             //od_printf("\n\r\n`bright`Well you ain't got enuf cash for that....\n\r");
  945.             if(!rip)
  946.               WaitForEnter();
  947.             else
  948.               od_get_answer("\n\r");
  949.               } else {
  950.             money_minus(intval);
  951.             cur_user.hitpoints=cur_user.maxhitpoints;
  952.             if (cur_user.hunger>=30)
  953.               cur_user.hunger-=30;
  954.             else
  955.               cur_user.hunger=0;
  956.             wrt_sts();
  957.             ny_line(110,2,1);
  958.             //od_printf("\n\r\n`bright red`Y`red`ou feel so refreshed yer hitpoints maxed out....\n\r");
  959.             if(!rip)
  960.               WaitForEnter();
  961.             else
  962.               od_get_answer("\n\r");
  963.               }
  964.             }
  965.           }
  966.         }
  967.         else if (key=='E') {
  968.           if(rip) no_rip_m=1;
  969.           if (cur_user.hunger==0) {
  970.             ny_line(106,2,1);
  971. //            od_printf("\n\r\n`bright green`Y`green`er not hungry....\n\r");
  972.             if(!rip)
  973.               WaitForEnter();
  974.             else
  975.               od_get_answer("\n\r");
  976.           } else {
  977.             ny_line(111,2,1);
  978.             if(rip)
  979.               od_get_answer("\n\r");
  980.             ny_line(112,0,1);
  981.             //od_printf("\n\r\n`bright red`T`red`hough not feeling that hungry anymore, you feel a bit worse and\n\rloose 1/3 of yer hitpoints...\n\r");
  982.             cur_user.hitpoints=cur_user.hitpoints*2/3;
  983.             if (cur_user.hunger>=25)
  984.               cur_user.hunger-=25;
  985.             else
  986.               cur_user.hunger=0;
  987.  
  988.             wrt_sts();
  989.             if(!rip)
  990.               WaitForEnter();
  991.             else
  992.               od_get_answer("\n\r");
  993.           }
  994.         }
  995.         else if (key=='S') {
  996.           if(rip) no_rip_m=1;
  997.           if (cur_user.level==0) {
  998.  
  999.             ny_line(113,2,1);
  1000. //            od_printf("\n\r\n`bright`Level 0 players can't steal....\n\r");
  1001.  
  1002.             if(!rip)
  1003.               WaitForEnter();
  1004.             else
  1005.               od_get_answer("\n\r");
  1006.           } else {
  1007.  
  1008.             ny_line(114,2,1);
  1009.             //od_printf("\n\r\n`bright red`Y`red`ou try to steel some food from a supermarket...\n\r");
  1010.  
  1011.             if(!rip)
  1012.               WaitForEnter();
  1013.             else
  1014.               od_get_answer("\n\r");
  1015.             chance=random(100);
  1016.             if (chance<=busted_ch_food) {
  1017.  
  1018.               od_printf("\n\r\n");
  1019.               ny_send_menu(BUSTED,"");
  1020.  
  1021. //              od_printf("\n\r\n`bright`BUSTED!!!! .... well the police beat the hell out of you .....\n\rWhy don't you try again tomorrow...\n\r");
  1022. //              od_printf("Ya lost 2%c of yer points!\n\r",37);
  1023.               cur_user.alive=UNCONCIOUS;
  1024.               points_loose(cur_user.points*.02);
  1025.               news_post("stealing food",cur_user.name,"",2);
  1026.               if(!rip)
  1027.             WaitForEnter();
  1028.               else
  1029.             od_get_answer("\n\r");
  1030.               od_exit(10,FALSE);
  1031.             } else {
  1032.               chance=random(100);
  1033.               if (chance<=success_ch_food) {
  1034.             intval=random(cur_user.hunger+2);
  1035.             if (cur_user.hunger<intval) intval= cur_user.hunger;
  1036.  
  1037.             ny_line(115,2,0);
  1038.             //od_printf("\n\r\n`bright red`Y`red`ou just stole enough so yer hunger went down by %d
  1039.             od_printf("%d%c",intval,37);
  1040.  
  1041.             cur_user.hunger-=intval;
  1042.             points_raise((long)25*cur_user.level);
  1043.             if(!rip) {
  1044.               od_disp_str("...\n\r");
  1045.               WaitForEnter();
  1046.             } else {
  1047.               od_disp_str("::^M@OK))|#|#|#\n\r");
  1048.               od_get_answer("\n\r");
  1049.             }
  1050.               } else {
  1051.             intval=2 * cur_user.level * DrgPtsCoef();
  1052.  
  1053.             ny_line(116,2,1);
  1054.             if(rip)
  1055.               od_get_answer("\n\r");
  1056.  
  1057.             ny_line(117,0,0);
  1058. //                od_printf("\n\r\n`bright red`Y`red`ou did not manage to steal anything but did not get busted...\n\r`bright red`Y`red`our points went up by %s\n\r",D_Num(intval));
  1059.             od_printf("%s",D_Num(intval));
  1060.  
  1061.             points_raise((long)13*cur_user.level);
  1062.             if(!rip) {
  1063.               od_disp_str("\n\r");
  1064.               WaitForEnter();
  1065.             } else {
  1066.               od_disp_str("::^M@OK))|#|#|#\n\r");
  1067.               od_get_answer("\n\r");
  1068.             }
  1069.               }
  1070.             }
  1071.           }
  1072.         }
  1073.     } while (key!='Q');
  1074. }
  1075.  
  1076.  
  1077. void
  1078. get_laid_ops(void)
  1079. {
  1080.     char key;
  1081.     long longval;
  1082.     long intval;
  1083.     int chance;
  1084.     char hand[25];
  1085.     char numstr[26];
  1086.     char line[80],ovr[80];
  1087.     FILE *justfile;
  1088.     FILE *msg_file;
  1089.     scr_rec urec;
  1090.     int unum,ret,cnt;
  1091.     mail_idx_type mail_idx;
  1092.     long fillen;
  1093.  
  1094.  
  1095.     do {
  1096.         key=callmenu("GSBYRPMQ?\n\r",SEX,348,FALSE);
  1097.         while (expert>0 && key=='?') {
  1098.           expert+=10;
  1099.           key=callmenu("GSBYRPMQ?\n\r",SEX,348,FALSE);
  1100.           expert-=10;
  1101.         }
  1102.  
  1103.  
  1104.         if (key=='Y') {
  1105.             DisplayStats();
  1106.             WaitForEnter();
  1107.             }
  1108.         else if (key=='R') {
  1109.           if(rip) no_rip_m=1;
  1110.           if (cur_user.sex_today<=0) {
  1111.  
  1112.             ny_line(118,2,1);
  1113. //            od_printf("\n\r\n`bright`You already used up all your sex turns today ...\n\r");
  1114.  
  1115.             if(!rip)
  1116.               WaitForEnter();
  1117.             else
  1118.               od_get_answer("\n\r");
  1119.           } else {
  1120.  
  1121.             ny_line(119,2,1);
  1122. //            od_printf("\n\r\n`bright red`Y`red`ou look for a victim...\n\r");
  1123.  
  1124.             if(!rip)
  1125.               WaitForEnter();
  1126.             else
  1127.               od_get_answer("\n\r");
  1128.             chance=random(100);
  1129.             if (chance<=busted_ch_rape) {
  1130.  
  1131.               od_printf("\n\r\n");
  1132.               ny_send_menu(BUSTED,"");
  1133.               //od_printf("\n\r\n`bright`BUSTED!!!! .... well the police beat the hell out of you .....\n\rWhy don't you try again tomorrow...\n\r");
  1134.               //od_printf("Ya lost 2%c of yer points!\n\r",37);
  1135.  
  1136.               cur_user.alive=UNCONCIOUS;
  1137.               points_loose(cur_user.points*.02);
  1138.               news_post("rape",cur_user.name,"",2);
  1139.               if(!rip)
  1140.             WaitForEnter();
  1141.               else
  1142.             od_get_answer("\n\r");
  1143.               od_exit(10,FALSE);
  1144.             } else {
  1145.               chance=random(100);
  1146.               if (chance<=success_ch_rape) {
  1147.  
  1148.             if (cur_user.sex==MALE) ny_line(120,2,1);// od_printf("\n\r\n`bright red`Y`red`ou raped some lady and ran away ... `bright red`G`red`ood job ...\n\r");
  1149.             else ny_line(121,2,1); //od_printf("\n\r\n`bright red`Y`red`ou raped some guy and ran away ... `bright red`G`red`ood job ...\n\r");
  1150.  
  1151.             cur_user.since_got_laid=0;
  1152.             cur_user.sex_today--;
  1153.             illness();
  1154.             points_raise((long)40*(cur_user.level+1));
  1155.             if(!rip)
  1156.               WaitForEnter();
  1157.             else
  1158.               od_get_answer("\n\r");
  1159.               } else {
  1160.  
  1161.             ny_line(122,2,1);
  1162. //                od_printf("\n\r\n`bright red`Y`red`ou couldn't find any victim...\n\r");
  1163.  
  1164.             cur_user.sex_today--;
  1165.             wrt_sts();
  1166.             if(!rip)
  1167.               WaitForEnter();
  1168.             else
  1169.               od_get_answer("\n\r");
  1170.               }
  1171.             }
  1172.           }
  1173.         }
  1174.         else if (key=='G') {
  1175.           if(rip) no_rip_m=1;
  1176.           if (cur_user.sex_today<=0) {
  1177.  
  1178.             ny_line(118,2,1);
  1179. //            od_printf("\n\r\n`bright`You already used up all your sex turns today ...\n\r");
  1180.  
  1181.             if(!rip)
  1182.               WaitForEnter();
  1183.             else
  1184.               od_get_answer("\n\r");
  1185.           } else {
  1186.             chance=random(22);
  1187.             if (chance<=cur_user.level) {
  1188.  
  1189.               if (cur_user.sex==MALE) ny_line(123,2,1);// od_printf("\n\r\n`bright red`Y`red`ou scored a pretty nice chick ... `bright red`G`red`ood job ...\n\r");
  1190.               else ny_line(124,2,1); //od_printf("\n\r\n`bright red`Y`red`ou scored some cool guy ... `bright red`G`red`ood job ...\n\r");
  1191.  
  1192.               cur_user.since_got_laid=0;
  1193.               cur_user.sex_today--;
  1194.               illness();
  1195.               points_raise((long)50*(cur_user.level+1));
  1196.               if(!rip)
  1197.             WaitForEnter();
  1198.               else
  1199.             od_get_answer("\n\r");
  1200.  
  1201.             } else {
  1202.  
  1203.               ny_line(125,2,1);
  1204. //              od_printf("\n\r\n`bright red`Y`red`ou couldn't find anybody who'd like you...\n\r");
  1205.               if(rip)
  1206.             od_get_answer("\n\r");
  1207.  
  1208.               ny_line(126,0,1);
  1209. //              od_printf("`bright red`T`red`he sex turns went down anyway...\n\r");
  1210.  
  1211.               cur_user.sex_today--;
  1212.               wrt_sts;
  1213.               if(!rip)
  1214.             WaitForEnter();
  1215.               else
  1216.             od_get_answer("\n\r");
  1217.             }
  1218.           }
  1219.         }
  1220.  
  1221.         else if (key=='P') {
  1222.           if(rip) no_rip_m=1;
  1223.           if (cur_user.sex_today<=0) {
  1224.  
  1225.             ny_line(118,2,1);
  1226. //            od_printf("\n\r\n`bright`You already used up all your sex turns today ...\n\r");
  1227.  
  1228.             if(!rip)
  1229.               WaitForEnter();
  1230.             else
  1231.               od_get_answer("\n\r");
  1232.  
  1233.           } else {
  1234.             intval=75+(50*cur_user.level);
  1235.  
  1236.             ny_line(127,2,0);
  1237.             //od_printf("\n\r\n`bright red`Y`red`ou can get a hooker fer
  1238.             od_printf(D_Num(intval));
  1239.             ny_line(128,0,0);
  1240.             // ... (`bright red`Y`red`/`bright red`N`red`)",D_Num(intval));
  1241.  
  1242.             key=ny_get_answer("YN");
  1243.             if(!rip)
  1244.               od_printf("%c\n\r\n",key);
  1245.             else
  1246.               od_disp_str("\n\r");
  1247.             if (key=='Y') {
  1248.               if(intval>cur_user.money) {
  1249.  
  1250.             ny_line(252,0,1);
  1251.             //you can afford it man
  1252.  
  1253.             if(!rip)
  1254.               WaitForEnter();
  1255.             else
  1256.               od_get_answer("\n\r");
  1257.               } else {
  1258.  
  1259.             ny_line(129,0,1);
  1260. //                od_printf("`bright red`O`red`k there you go...\n\r");
  1261.  
  1262.             cur_user.since_got_laid=0;
  1263.             cur_user.sex_today--;
  1264.             money_minus(intval);
  1265.             illness();
  1266.             points_raise((long)25*(cur_user.level+1));
  1267.             if(!rip)
  1268.               WaitForEnter();
  1269.             else
  1270.               od_get_answer("\n\r");
  1271.               }
  1272.             }
  1273.           }
  1274.         }
  1275.         else if (key=='S') {
  1276.           if (cur_user.sex_today<=0) {
  1277.  
  1278.             ny_line(118,2,1);
  1279. //            od_printf("\n\r\n`bright`You already used up all your sex turns today ...\n\r");
  1280.  
  1281.             if(!rip)
  1282.               WaitForEnter();
  1283.             else {
  1284.               od_get_answer("\n\r");
  1285.               no_rip_m=1;
  1286.             }
  1287.  
  1288.           } else {
  1289.  
  1290.             if (cur_user.sex==MALE) ny_line(130,2,0); //od_printf("\n\r\n`bright red`Y`red`ou wanna list all the female players (`bright red`Y`red`/`bright red`N`red`)");
  1291.             else ny_line(131,2,0); //od_printf("\n\r\n`bright red`Y`red`ou wanna list all the male players (`bright red`Y`red`/`bright red`N`red`)");
  1292.  
  1293.             key=ny_get_answer("YN");
  1294.             if(!rip)
  1295.               od_printf("%c\n\r",key);
  1296.             else
  1297.               od_disp_str("\n\r  \b\b");
  1298.             if (key=='Y') {
  1299.               if (cur_user.sex==MALE) ListPlayersS(FEMALE); else ListPlayersS(MALE);
  1300.               od_printf("\n\r");
  1301.             }
  1302.             if(rip) od_send_file("TFRAME3.RIP");
  1303.  
  1304.             ny_line(132,1,0);
  1305. //            od_printf("\n\r\n`bright red`W`red`ho ya wanna screw (`bright red`full`red` or `bright red`partial`red` name):`bright green`");
  1306.  
  1307.             od_input_str(hand,24,' ',255);
  1308.             ny_un_emu(hand);
  1309.             //od_printf("\n\r");
  1310.             unum=0;
  1311.             ret=1;
  1312.             if (hand[0]!=0) {
  1313.               do {
  1314.             ch_game_d();
  1315.             justfile=ShareFileOpen(SCR_FILENAME,"rb");
  1316.             fseek(justfile,sizeof(scr_rec) * (long)unum,SEEK_SET);
  1317.             do {
  1318.               ret=ny_fread(&urec,sizeof(scr_rec),1,justfile);
  1319.               unum++;
  1320.               //time_slice();
  1321.             } while ((strzcmp(hand,ny_un_emu(urec.name,numstr)) || urec.sex==cur_user.sex) && ret==1);
  1322.             fclose(justfile);
  1323.               } while (ret==1 && askifuser(urec.name)==FALSE);
  1324.             }
  1325.             if (ret!=1) {
  1326.  
  1327.               ny_line(133,1,1);
  1328.               if(rip)
  1329.             od_get_answer("\n\r");
  1330.  
  1331.               //od_printf("\n\r`bright red`G`red`ot no idea who you mean ...");
  1332.  
  1333.             //  WaitForEnter();
  1334.             } else if (hand[0]!=0) {
  1335.  
  1336.               user_rec u2rec;
  1337.  
  1338.               ch_game_d();
  1339.               justfile=ShareFileOpen(USER_FILENAME,"rb");
  1340.               fseek(justfile,sizeof(user_rec) * (long)urec.user_num,SEEK_SET);
  1341.               ny_fread(&u2rec,sizeof(user_rec),1,justfile);
  1342.               fclose(justfile);
  1343.  
  1344.               ny_line(134,1,1);
  1345. //              od_printf("\n\r`bright red`H`red`ow you gonna ask? (`bright red`/s`red`=save `bright red`/a`red`=abort):\n\r");
  1346.  
  1347.               ch_flag_d();
  1348.               sprintf(numstr,"u%07d.tmg",nCurrentUserNumber);
  1349.               justfile=ShareFileOpen(numstr,"wb");
  1350.               cnt= -1;
  1351.               ovr[0]=0;
  1352.               do {
  1353.             cnt++;
  1354.             get_line(ovr,line,ovr,TRUE);
  1355.             ny_fwrite(&line,80,1,justfile);
  1356.               } while ((line[0]!='/' && (line[1]!='s' || line[1]!='S')) && (line[0]!='/' && (line[1]!='a' || line[1]!='A')));
  1357.               fclose(justfile);
  1358.               if (line[1]=='s' || line[1]=='S') {
  1359.             ny_line(135,0,1);
  1360. //            od_printf("`bright red`S`red`aving...\n\r");
  1361.             mail_idx.length=cnt;
  1362.             strcpy(mail_idx.sender,cur_user.name);
  1363.             strcpy(mail_idx.recver,urec.name);
  1364.             strcpy(mail_idx.senderI,cur_user.bbsname);
  1365.             strcpy(mail_idx.recverI,u2rec.bbsname);
  1366.             mail_idx.afterquote=0;
  1367.             mail_idx.deleted=FALSE;
  1368.             mail_idx.sender_sex=cur_user.sex;
  1369.             mail_idx.flirt=1;
  1370.             mail_idx.ill=cur_user.std;
  1371.             mail_idx.inf=cur_user.std_percent;
  1372.             ch_flag_d();
  1373.             justfile=ShareFileOpen(numstr,"rb");
  1374.             ch_game_d();
  1375.             msg_file=ShareFileOpen(MAIL_FILENAME,"a+b");
  1376.             fillen=filelength(fileno(msg_file));
  1377.             fillen/=80;
  1378.             mail_idx.location=fillen;
  1379.             while ((cnt--)>0) {
  1380.               ny_fread(&line,80,1,justfile);
  1381.               ny_fwrite(&line,80,1,msg_file);
  1382.               //time_slice();
  1383.             }
  1384.             fclose(msg_file);
  1385.             fclose(justfile);
  1386.             ch_flag_d();
  1387.             ny_remove(numstr);
  1388. //            sprintf(numstr,"del u%07d.tmg");
  1389. //            system(numstr);
  1390.             ch_game_d();
  1391.             msg_file=ShareFileOpen(MAIL_INDEX,"a+b");
  1392.             ny_fwrite(&mail_idx,sizeof(mail_idx_type),1,msg_file);
  1393.             fclose(msg_file);
  1394.             cur_user.sex_today--;
  1395.             if(single_node==FALSE && urec.online==TRUE) {
  1396.               ch_flag_d();
  1397.               sprintf(numstr,"u%07d.omg",urec.user_num);
  1398.               char omg[2];
  1399.               omg[0]=27;
  1400.               omg[1]=0;
  1401.               justfile=ShareFileOpen(numstr,"a+b");
  1402.               ny_fwrite(&omg,51,1,justfile);
  1403.               ny_fwrite(&cur_user.name,25,1,justfile);
  1404.               fclose(justfile);
  1405.             }
  1406.             if(rip)
  1407.               od_get_answer("\n\r");
  1408.               } else {
  1409.             ny_line(136,0,1);
  1410.             if(rip)
  1411.               od_get_answer("\n\r");
  1412.  
  1413.             //od_printf("\b\b`bright red`A`red`borted...\n\r");
  1414.             //sprintf(numstr,"del u%07d.tmg");
  1415.             //system(numstr);
  1416.             ch_flag_d();
  1417.             ny_remove(numstr);
  1418.               }
  1419.             }
  1420.             if(!rip) WaitForEnter();
  1421.           }
  1422.         }
  1423.  
  1424.         else if (key=='M') {
  1425.           if(registered==FALSE) {
  1426.             ny_disp_emu("`%\n\r\nUNREGISTERED!!!\n\r\nCannot do this!!!\n\r");
  1427.             WaitForEnter();
  1428.           } else if (cur_user.sex_today<=0) {
  1429.             if(rip) no_rip_m=1;
  1430.  
  1431.             ny_line(118,2,1);
  1432.             //od_printf("\n\r\n`bright`You already used up all your sex turns today ...\n\r");
  1433.  
  1434.             if(!rip)
  1435.               WaitForEnter();
  1436.             else
  1437.               od_get_answer("\n\r");
  1438.  
  1439.           } else {
  1440.             if(rip) no_rip_m=1;
  1441.  
  1442.             ny_line(137,2,1);
  1443.             if(rip)
  1444.               od_get_answer("\n\r");
  1445. //            od_printf("\n\r\n`bright red`W`red`ell it aint the real thing, but at least you don't feel\n\r");
  1446.             ny_line(138,0,1);
  1447.   //            od_printf("that you didn't have REAL sex in such a long time, and you can't get sick\n\rlike this.\n\r");
  1448.  
  1449.             cur_user.since_got_laid/=2;
  1450.             cur_user.sex_today--;
  1451.             points_raise((long)12*(cur_user.level+1));
  1452.             if(!rip)
  1453.               WaitForEnter();
  1454.             else
  1455.               od_get_answer("\n\r");
  1456.           }
  1457.         }
  1458.         else if (key=='B') {
  1459.           if(registered==FALSE) {
  1460.             ny_disp_emu("`%\n\r\nUNREGISTERED!!!\n\r\nCannot do this!!!\n\r");
  1461.             WaitForEnter();
  1462.           } else {
  1463.  
  1464.             ny_line(139,2,0);
  1465.             //od_printf("\n\r\n`bright green`Y`green`ou got `bright green`
  1466.             od_printf("%d",cur_user.condoms);
  1467.             ny_line(140,0,2);
  1468. //            `green` condoms.\n\r\n
  1469.             if(rip)
  1470.               od_get_answer("\n\r");
  1471.  
  1472.             if(rip) {
  1473.               od_send_file("input.rip");
  1474.             }
  1475.  
  1476.             longval=cur_user.money/condom_price;
  1477.             if (longval+cur_user.condoms>INT_MAX) longval=INT_MAX-cur_user.condoms;
  1478.             ny_line(141,0,0);
  1479.             //od_printf("`bright green`H`green`ow much ya want? (`bright blue`Enter`green`=`bright green`[0]`green`, `bright blue`M`green`=max `bright green`
  1480.             od_printf(D_Num(longval));
  1481.             ny_disp_emu("`2):");
  1482.  
  1483.             intval = get_val((unsigned long)0,(unsigned long)longval);
  1484.             cur_user.condoms+=intval;
  1485.             money_minus(intval * condom_price);
  1486.             wrt_sts();
  1487.  
  1488.             ny_line(142,1,0);
  1489.             //od_printf("\n\r`bright red`O`red`k you now got `bright red`
  1490.             od_printf("%d",cur_user.condoms);
  1491.             ny_line(143,0,1);
  1492.  
  1493.             if(!rip)
  1494.               WaitForEnter();
  1495.             else
  1496.               od_get_answer("\n\r");
  1497.           }
  1498.         }
  1499.  
  1500.     } while (key!='Q');
  1501. }
  1502.  
  1503.  
  1504. void
  1505. disp_fig_stats(void)
  1506. {
  1507.     od_printf("`cyan`Hitpoints: `bright green`%s  ",D_Num(cur_user.hitpoints));
  1508.     od_printf("`cyan`Fights Left: `bright green`%d  ",(int)cur_user.turns);
  1509.     od_printf("`cyan`Points: `bright green`%s  ",D_Num(cur_user.points));
  1510.     od_printf("`cyan`Money: `bright green`%s\n\r",D_Num(cur_user.money));
  1511. }
  1512.  
  1513.  
  1514.  
  1515.  
  1516.  
  1517. void
  1518. illness(void)  // std's and stuff
  1519. {
  1520.   int intval;
  1521.   desease ill;
  1522.  
  1523.   ill = (desease)(random(AIDS-cur_user.std+2)+cur_user.std-1);
  1524.   if (ill>AIDS) ill=AIDS;
  1525.  
  1526.   if (ill>=cur_user.std && ill!=NONE) {
  1527.     cur_user.std=ill;
  1528.     if (cur_user.condoms>0) {
  1529.  
  1530.       ny_line(144,1,1);
  1531. //      od_printf("\n\r`bright red`Y`red`ou used a condom and got only 1/2 infected...\n\r");
  1532.  
  1533.       if(rip)
  1534.     od_get_answer("\n\r");
  1535.       cur_user.condoms--;
  1536.       cur_user.std_percent+=ill*2;
  1537.     } else {
  1538.       cur_user.std_percent+=ill*4;
  1539.     }
  1540.  
  1541.     ny_line(145,1,0);
  1542.     //od_printf("\n\r`bright red`Y`red`ou are now `bright green`
  1543.     od_printf("%d",(int)cur_user.std_percent);
  1544.     ny_line(146,0,0);
  1545. //    `red`%c infected with `brigh green`",(int)cur_user.std_percent,37);
  1546.     print_disease(ill);
  1547.     wrt_sts();
  1548.     if(rip) {
  1549.       od_disp_str("::^M@OK))|#|#|#\n\r");
  1550.       od_get_answer("\n\r");
  1551.     } else
  1552.       od_printf("\n\r");
  1553.  
  1554.  
  1555.     if (cur_user.std_percent>=100) {
  1556.       if(!rip) WaitForEnter();
  1557.       Die(3);
  1558.     }
  1559.   }
  1560. }
  1561.  
  1562.  
  1563.  
  1564.  
  1565.  
  1566. void
  1567. illness(desease ill, int inf, int rape)  // std's and stuff from players
  1568. {
  1569. //  printf("\n\n%d\n\n",inf);
  1570. //  WaitForEnter();
  1571.  
  1572.   if(ill>AIDS) ill=AIDS;
  1573.   if(cur_user.std>AIDS) cur_user.std=AIDS;
  1574.   if (ill>=cur_user.std && ill!=NONE) {
  1575.     cur_user.std=ill;
  1576.     if (cur_user.condoms>0 && rape==FALSE) {
  1577.       if(inf<4) inf=4;
  1578.  
  1579.       ny_line(144,1,1);
  1580. //      od_printf("\n\r`bright red`Y`red`ou used a condom and got only 1/2 infected...\n\r");
  1581.  
  1582.       if(rip)
  1583.     od_get_answer("\n\r");
  1584.       cur_user.condoms--;
  1585.       cur_user.std_percent+=inf/4;
  1586.     } else {
  1587.       if(inf<2) inf=2;
  1588.       cur_user.std_percent+=inf/2;
  1589.     }
  1590.  
  1591.  
  1592.     //od_printf("\n\r`bright red`Y`red`ou are now `bright green`%d`red`%c infected with `brigh green`",(int)cur_user.std_percent,37);
  1593.     ny_line(145,1,0);
  1594.     od_printf("%d",(int)cur_user.std_percent,37);
  1595.     ny_line(146,0,0);
  1596.     print_disease(ill);
  1597.     wrt_sts();
  1598.     if(rip) {
  1599.       od_disp_str("::^M@OK))|#|#|#\n\r");
  1600.       od_get_answer("\n\r");
  1601.     } else
  1602.       od_printf("\n\r");
  1603.  
  1604.  
  1605.     if (cur_user.std_percent>=100) {
  1606.       if(!rip) WaitForEnter();
  1607.       Die(3);
  1608.     }
  1609.   }
  1610. }
  1611.  
  1612.  
  1613.  
  1614. void
  1615. money_ops(void)
  1616. {
  1617.     char key;
  1618.     unsigned long intval;
  1619.     int chance;
  1620.     unsigned long med;
  1621.     char hand[25];
  1622.     char omg[51];
  1623.     char numstr[26];
  1624.     char line[80];
  1625.     FILE *justfile;
  1626.     FILE *msg_file;
  1627.     scr_rec urec;
  1628.     user_rec u2rec;
  1629.     int unum,ret;
  1630.     mail_idx_type mail_idx;
  1631.     long fillen;
  1632.  
  1633.  
  1634.     do {
  1635.         key=callmenu("DWGSYQ?\n\r",BANK,349,FALSE);
  1636.         while (expert>0 && key=='?') {
  1637.           expert+=10;
  1638.           key=callmenu("DWGSYQ?\n\r",BANK,349,FALSE);
  1639.           expert-=10;
  1640.         }
  1641.  
  1642.         if(key == 'S') {
  1643.           if(rip) od_send_file("texti.rip");
  1644.           ny_line(416,2,0);
  1645.           od_input_str(hand,24,' ',255);
  1646.           ny_un_emu(hand);
  1647.           unum=0;
  1648.           ret=1;
  1649.           if (hand[0]!=0) {
  1650.         do {
  1651.           ch_game_d();
  1652.           justfile=ShareFileOpen(SCR_FILENAME,"rb");
  1653.           fseek(justfile,sizeof(scr_rec) * (long)unum,SEEK_SET);
  1654.           do {
  1655.             ret=ny_fread(&urec,sizeof(scr_rec),1,justfile);
  1656.             unum++;
  1657.             //time_slice();
  1658.           } while ((strzcmp(hand,ny_un_emu(urec.name,numstr)) || urec.user_num==nCurrentUserNumber) && ret==1);
  1659.           fclose(justfile);
  1660.         } while (ret==1 && askifuser(urec.name)==FALSE);
  1661.           }
  1662.           if (ret!=1) {
  1663.         ny_line(133,1,1);
  1664.         if(!rip)
  1665.           WaitForEnter();
  1666.         else
  1667.           od_get_answer("\n\r");
  1668.           } else if (hand[0]!=0) {
  1669.         ch_game_d();
  1670.         justfile=ShareFileOpen(USER_FILENAME,"rb");
  1671.         fseek(justfile,sizeof(user_rec) * (long)urec.user_num,SEEK_SET);
  1672.         ny_fread(&u2rec,sizeof(user_rec),1,justfile);
  1673.         fclose(justfile);
  1674.         if(rip) {
  1675.           od_send_file("input.rip");
  1676.         }
  1677.         ny_line(417,1,0);
  1678.         od_printf(D_Num(cur_user.money));
  1679.         ny_disp_emu("`2):");
  1680.         intval=get_val((unsigned long)0,cur_user.money);
  1681.         if (intval>0) {
  1682.           cur_user.money-=intval;
  1683.           wrt_sts();
  1684.           ny_line(418,1,1);
  1685.           mail_idx.flirt=1002;
  1686.           mail_idx.length=1;
  1687.           strcpy(mail_idx.sender,cur_user.name);
  1688.           strcpy(mail_idx.senderI,cur_user.bbsname);
  1689.           strcpy(mail_idx.recver,urec.name);
  1690.           strcpy(mail_idx.recverI,u2rec.bbsname);
  1691.           mail_idx.afterquote=0;
  1692.           mail_idx.deleted=FALSE;
  1693.           mail_idx.sender_sex=cur_user.sex;
  1694.           mail_idx.ill=cur_user.std;
  1695.           mail_idx.inf=cur_user.std_percent;
  1696.           ch_game_d();
  1697.           msg_file=ShareFileOpen(MAIL_FILENAME,"a+b");
  1698.           fillen=filelength(fileno(msg_file));
  1699.           fillen/=80;
  1700.           mail_idx.location=fillen;
  1701.           ny_fwrite(&intval,80,1,msg_file);
  1702.           fclose(msg_file);
  1703.           msg_file=ShareFileOpen(MAIL_INDEX,"a+b");
  1704.           ny_fwrite(&mail_idx,sizeof(mail_idx_type),1,msg_file);
  1705.           fclose(msg_file);
  1706.           if(single_node==FALSE && urec.online==TRUE) {
  1707.             ch_flag_d();
  1708.             sprintf(numstr,"u%07d.omg",urec.user_num);
  1709.             omg[0]=27;
  1710.             omg[1]=0;
  1711.             justfile=ShareFileOpen(numstr,"a+b");
  1712.             ny_fwrite(&omg,51,1,justfile);
  1713.             ny_fwrite(&cur_user.name,25,1,justfile);
  1714.             fclose(justfile);
  1715.           }
  1716.           if(!rip)
  1717.             WaitForEnter();
  1718.           else
  1719.             od_get_answer("\n\r");
  1720.         }
  1721.           }
  1722.         } else if (key == 'D') { //deposit in bank
  1723.  
  1724.            med=ULONG_MAX-cur_user.money;
  1725.            if (med<=cur_user.bank)
  1726.          intval=med;
  1727.            else
  1728.          intval=cur_user.money;
  1729.  
  1730.            if(rip) {
  1731.          od_send_file("input.rip");
  1732.            }
  1733.  
  1734.            ny_line(147,2,0);
  1735.            //od_printf("\n\r\n`bright green`H`green`ow much ya want to deposit? (`bright blue`Enter`green`=`bright green`[0]`green`, `bright blue`M`green`=max `bright green`
  1736.            od_printf(D_Num(intval));
  1737.            ny_disp_emu("`2):");
  1738.  
  1739.  
  1740.            intval=get_val((unsigned long)0,intval);
  1741.            cur_user.money-=intval;
  1742.            cur_user.bank+=intval;
  1743.            wrt_sts();
  1744.  
  1745.            ny_line(148,1,0);
  1746.            //od_printf("\n\r`bright red`Y`red`ou got `bright red`
  1747.            od_printf(D_Num(cur_user.bank));
  1748.            ny_line(149,0,1);
  1749.            //`red` in the bank...\n\r",D_Num(cur_user.bank));
  1750.  
  1751.            if(!rip)
  1752.          WaitForEnter();
  1753.            else
  1754.          od_get_answer("\n\r");
  1755.         }
  1756.         else if (key=='W') { ///widthraw from bank
  1757.  
  1758.            med=ULONG_MAX-cur_user.bank;
  1759.            if (med<=cur_user.money)
  1760.          intval=med;
  1761.            else
  1762.          intval=cur_user.bank;
  1763.            if(rip) {
  1764.          od_send_file("input.rip");
  1765.            }
  1766.  
  1767.            ny_line(150,2,0);
  1768.            //od_printf("\n\r\n`bright green`H`green`ow much ya want to widthraw? (`bright blue`Enter`green`=`bright green`[0]`green`, `bright blue`M`green`=max `bright green`
  1769.            od_printf(D_Num(intval));
  1770.            ny_disp_emu("`2):");
  1771.  
  1772.            intval=get_val((unsigned long)0,intval);
  1773.            cur_user.bank-=intval;
  1774.            cur_user.money+=intval;
  1775.            wrt_sts();
  1776.  
  1777.            ny_line(148,1,0);
  1778.            //od_printf("\n\r`bright red`Y`red`ou got `bright red`
  1779.            od_printf(D_Num(cur_user.money));
  1780.            ny_line(151,0,1);
  1781.            //`red` on ya...\n\r",D_Num(cur_user.money));
  1782.  
  1783.            if(!rip)
  1784.          WaitForEnter();
  1785.            else
  1786.          od_get_answer("\n\r");
  1787.         }
  1788.         else if (key=='Y') {   //display stats
  1789.         DisplayStats();
  1790.         WaitForEnter();
  1791.         }
  1792.         else if (key=='G') {  //steal money
  1793.         if(rip) no_rip_m=1;
  1794.         if (cur_user.level==0) {
  1795.  
  1796.           ny_line(113,2,1);
  1797.           //od_printf("\n\r\n`bright`Level 0 players can't steall....\n\r");
  1798.  
  1799.           if(!rip)
  1800.             WaitForEnter();
  1801.           else
  1802.             od_get_answer("\n\r");
  1803.         } else {
  1804.  
  1805.           ny_line(152,2,1);
  1806.           //od_printf("\n\r\n`bright red`Y`red`ou try to steel some money from the bank...\n\r");
  1807.  
  1808.           if(!rip)
  1809.             WaitForEnter();
  1810.           else
  1811.             od_get_answer("\n\r");
  1812.           chance=random(100);
  1813.           if (chance<=busted_ch_bank) {
  1814.  
  1815.             od_printf("\n\r\n");
  1816.             ny_send_menu(BUSTED,"");
  1817.             //od_printf("\n\r\n`bright`BUSTED!!!! .... well the police beat the hell out of you .....\n\rWhy don't you try again tomorrow...\n\r");
  1818.             //od_printf("Ya lost 2%c of yer points!\n\r",37);
  1819.  
  1820.             cur_user.alive=UNCONCIOUS;
  1821.             points_loose(cur_user.points*.02);
  1822.             news_post("robbing bank",cur_user.name,"",2);
  1823.             if(!rip)
  1824.               WaitForEnter();
  1825.             else
  1826.               od_get_answer("\n\r");
  1827.             od_exit(10,FALSE);
  1828.           } else {
  1829.             chance=random(100);
  1830.             if (chance<=success_ch_bank) {
  1831.               intval=random(cur_user.level*700);
  1832.  
  1833.               ny_line(153,2,0);
  1834.               //od_printf("\n\r\n`bright red`Y`red`ou just stole
  1835.               od_printf(D_Num(intval));
  1836.               ny_line(154,0,1);
  1837.               // without getting busted, good job...\n\r",intval);
  1838.  
  1839.               money_plus(intval);
  1840.               points_raise((long)55*cur_user.level);
  1841.               if(!rip)
  1842.             WaitForEnter();
  1843.               else
  1844.             od_get_answer("\n\r");
  1845.             } else {
  1846.               intval=5*cur_user.level*DrgPtsCoef();
  1847.  
  1848.               ny_line(155,2,1);
  1849.               if(rip)
  1850.             od_get_answer("\n\r");
  1851.               //od_printf("\n\r\n`bright red`Y`red`ou did not manage to steal anything but did not get busted...\n\r`bright red`Y`red`our points went up by
  1852.               ny_line(117,0,0);
  1853.               od_printf("%s\n\r",D_Num(intval));
  1854.  
  1855.               points_raise((long)20*cur_user.level);
  1856.               if(!rip)
  1857.             WaitForEnter();
  1858.               else
  1859.             od_get_answer("\n\r");
  1860.             }
  1861.           }
  1862.         }
  1863.         }
  1864.     } while (key!='Q');
  1865. }
  1866.  
  1867. void
  1868. drug_ops(void)
  1869. {
  1870.     char s_key,
  1871.          t_key,
  1872.          f_key,
  1873.          inputs[25];
  1874.     long  max,
  1875.          quant;
  1876.  
  1877.             do {
  1878.               s_key=callmenu("BSUYCQ?\n\r",DRUGS,350,FALSE);
  1879.               while (expert>0 && s_key=='?') {
  1880.                 expert+=10;
  1881.                 s_key=callmenu("BSUYCQ?\n\r",DRUGS,350,FALSE);
  1882.                 expert-=10;
  1883.               }
  1884.  
  1885.               if (s_key=='Y') {
  1886.                 DisplayStats();
  1887.                 WaitForEnter();
  1888.                 }
  1889.               else if (s_key=='B') {           // buy drugs
  1890.  
  1891.                 ny_line(156,2,0);
  1892.                 //od_printf("\n\r\n`bright green`Y`green`er drug of choice is: `bright green`");
  1893.                 print_drug(cur_user.drug);
  1894.                 if(rip) {
  1895.                   od_disp_str("::^M@OK))|#|#|#\n\r");
  1896.                   od_get_answer("\n\r");
  1897.                 }
  1898.  
  1899.  
  1900.                 ny_line(157,2,0);
  1901.                 //od_printf("\n\r\n`bright green`T`green`he price is `bright green`
  1902.                 od_printf("%s",D_Num(drug_price[cur_user.drug]*(cur_user.level+1)));
  1903.                 if(!rip)
  1904.                   od_printf("\n\r\n");
  1905.                 else {
  1906.                   od_disp_str("::^M@OK))|#|#|#\n\r");
  1907.                   od_get_answer("\n\r");
  1908.                 }
  1909.                 max=cur_user.money/(drug_price[cur_user.drug]*(cur_user.level+1));
  1910.                 if ((max+cur_user.drug_hits)>INT_MAX) max=INT_MAX-cur_user.drug_hits;
  1911.                 if ((cur_user.drug_hits+max)>max_drug_hits) max=max_drug_hits-cur_user.drug_hits;
  1912.                 if(rip) {
  1913.                   od_send_file("input.rip");
  1914.                 }
  1915.                 ny_line(158,0,0);
  1916.                 //od_printf("`bright green`H`green`ow much ya want? (`bright blue`Enter`green`=`bright green`[0]`green`, `bright blue`M`green`=max `bright green`
  1917.                 od_printf("%d",max);
  1918.                 ny_disp_emu("`2):");
  1919.  
  1920.  
  1921.                 quant=get_val((unsigned long)0,(unsigned long)max);
  1922.  
  1923.                 cur_user.drug_hits+=quant;
  1924.                 money_minus(quant*(drug_price[cur_user.drug]*(cur_user.level+1)));
  1925. //                points_raise((unsigned long)2*(cur_user.level+1));
  1926.  
  1927.                 ny_line(159,1,0);
  1928. //                od_printf("\n\r`bright red`O`red`k you now have `bright red`
  1929.                 od_printf("%d",cur_user.drug_hits);
  1930.                 ny_line(160,0,1);
  1931.                 //`red` hits!\n\r",cur_user.drug_hits);
  1932.  
  1933.                 if(!rip)
  1934.                   WaitForEnter();
  1935.                 else
  1936.                   od_get_answer("\n\r");
  1937.                 }
  1938.               else if (s_key=='S') {   // Sell drugs
  1939.  
  1940.                 ny_line(156,2,0);
  1941.                 //od_printf("\n\r\n`bright green`Y`green`er drug of choice is: `bright green`");
  1942.                 print_drug(cur_user.drug);
  1943.  
  1944.                 if(rip) {
  1945.                   od_disp_str("::^M@OK))|#|#|#\n\r");
  1946.                   od_get_answer("\n\r");
  1947.                 }
  1948.  
  1949.                 ny_line(161,2,0);
  1950.                 //od_printf("\n\r\n`bright green`Y`green`a can sell it for `bright green`
  1951.                 od_printf("%s",D_Num((drug_price[cur_user.drug]*(cur_user.level+1))/2));
  1952.                 if(!rip)
  1953.                   od_printf("\n\r\n");
  1954.                 else {
  1955.                   od_disp_str("::^M@OK))|#|#|#\n\r");
  1956.                   od_get_answer("\n\r");
  1957.                 }
  1958.  
  1959.                 max=cur_user.drug_hits;
  1960.  
  1961.                 if(rip) {
  1962.                   od_send_file("input.rip");
  1963.                 }
  1964.  
  1965.  
  1966.                 ny_line(162,0,0);
  1967.                 //od_printf("`bright green`H`green`ow much ya wanna sell? (`bright blue`Enter`green`=`bright green`[0]`green`, `bright blue`M`green`=max `bright green`
  1968.                 od_printf("%d",max);
  1969.                 ny_disp_emu("`2):");
  1970.  
  1971.  
  1972.                 quant=get_val((unsigned long)0,(unsigned long)max);
  1973.  
  1974.                 cur_user.drug_hits-=quant;
  1975.                 money_plus(quant*((drug_price[cur_user.drug]*(cur_user.level+1))/2));
  1976. //                points_raise((unsigned long)quant*(cur_user.level+1));
  1977.  
  1978.                 ny_line(159,1,0);
  1979.                 od_printf("%d",cur_user.drug_hits);
  1980.                 ny_line(160,0,1);
  1981.                 //od_printf("\n\r`bright red`O`red`k you now have `bright red`%d`red` hits!\n\r",cur_user.drug_hits);
  1982.  
  1983.                 if(!rip)
  1984.                   WaitForEnter();
  1985.                 else
  1986.                   od_get_answer("\n\r");
  1987.                 }
  1988.               else if (s_key=='C') {      //change drug
  1989.                 if(rip) no_rip_m=1;
  1990.                 if (cur_user.drug>=COKE && cur_user.drug_addiction>0) {
  1991.  
  1992.                   ny_line(163,2,1);
  1993.                   //od_printf("\n\r\n`bright`You are addicted to another drug.... First you heffta get off of that...\n\r");
  1994.  
  1995.                   if(!rip)
  1996.                 WaitForEnter();
  1997.                   else
  1998.                 od_get_answer("\n\r");
  1999.                 } else if (cur_user.drug_high>0) {
  2000.                   ny_line(415,2,1);
  2001.                   if(!rip)
  2002.                 WaitForEnter();
  2003.                   else
  2004.                 od_get_answer("\n\r");
  2005.                 } else {
  2006.  
  2007.                   //if(rip) ny_clr_scr();
  2008.                   ny_line(164,2,2);
  2009.                   //od_printf("\n\r\n`bright red`W`red`hich drug you wanna switch to...\n\r\n`bright green`");
  2010.                   if(!rip) ny_send_menu(CH_DRUG,"");
  2011. /*                  if (cur_user.drug!=POT) od_printf("1`green`. `bright green`P`green`ot\n\r");
  2012.                   if (cur_user.drug!=HASH) od_printf("`bright green`2`green`. `bright green`H`green`ash\n\r");
  2013.                   if (cur_user.drug!=LSD) od_printf("`bright green`3`green`. `bright green`L`green`SD\n\r");
  2014.                   if (cur_user.drug!=COKE) od_printf("`bright green`4`green`. `bright green`C`green`oke\n\r");
  2015.                   if (cur_user.drug!=PCP) od_printf("`bright green`5`green`. `bright green`P`green`CP\n\r");
  2016.                   if (cur_user.drug!=HEROIN) od_printf("`bright green`6`green`. `bright green`H`green`eroin\n\r\n");*/
  2017.  
  2018.                   if(!rip) ny_line(165,0,0);
  2019.                   //od_printf("`bright red`S`red`o....(`bright green`[0]`red`=quit):");
  2020.  
  2021.                   no_kernel=TRUE;
  2022.                   t_key=ny_get_answer("0123456\n\r");
  2023.                   no_kernel=FALSE;
  2024.                   if (t_key=='\n' || t_key=='\r') t_key='0';
  2025.                   if(!rip) od_putch(t_key);
  2026.                   if (t_key!='0') {
  2027.  
  2028.                 if(cur_user.drug_hits>0) {
  2029.                   ny_line(166,2,0);
  2030.  
  2031.                   //od_printf("`bright red`Y`red`ou'll heffta sell all the hits of yer old drug! Do it?(`bright red`Y`red`/`bright red`N`red`)");
  2032.  
  2033.                   f_key=ny_get_answer("YN");
  2034.                   if(!rip) od_putch(f_key);
  2035.                 } else {
  2036.                   f_key='Y';
  2037.                 }
  2038.                 if (f_key!='N') {
  2039.                   money_plus(cur_user.drug_hits*(drug_price[cur_user.drug]*(cur_user.level+1)));
  2040.                   cur_user.drug_hits=0;
  2041.  
  2042.                   ny_line(167,2,0);
  2043.                   //od_printf("`bright red`Y`red`er drug of choice set to: `bright green`");
  2044.                   if (t_key=='1') print_drug(cur_user.drug=POT);
  2045.                   else if (t_key=='2') print_drug(cur_user.drug=HASH);
  2046.                   else if (t_key=='3') print_drug(cur_user.drug=LSD);
  2047.                   else if (t_key=='4') print_drug(cur_user.drug=COKE);
  2048.                   else if (t_key=='5') print_drug(cur_user.drug=PCP);
  2049.                   else if (t_key=='6') print_drug(cur_user.drug=HEROIN);
  2050.  
  2051.                   wrt_sts();
  2052.                   if(!rip) {
  2053.                     od_printf("\n\r");
  2054.                     WaitForEnter();
  2055.                   } else {
  2056.                     od_disp_str("::^M@OK))|#|#|#\n\r");
  2057.                     od_get_answer("\n\r");
  2058.                   }
  2059.                   /*    } else {
  2060.                   od_printf("\n\r");
  2061.                   WaitForEnter();*/
  2062.                 }
  2063.                   }
  2064.                  }
  2065.                 }
  2066.                 else if (s_key=='U') {             //use drugs
  2067.                   take_drug();
  2068.                 }
  2069.               } while (s_key!='Q');
  2070. }
  2071.  
  2072.  
  2073.  
  2074.  
  2075. void
  2076. money_plus(unsigned long howmuch)
  2077. {
  2078.   unsigned long med;
  2079.  
  2080.   med=ULONG_MAX-howmuch;
  2081.   if (med<=cur_user.money)
  2082.     cur_user.money=ULONG_MAX;
  2083.   else
  2084.     cur_user.money+=howmuch;
  2085.   od_control.od_update_status_now=TRUE;
  2086. }
  2087.  
  2088.  
  2089.  
  2090.  
  2091.  
  2092. void
  2093. money_minus(unsigned long howmuch)
  2094. {
  2095.   if (howmuch>=cur_user.money)
  2096.     cur_user.money=0;
  2097.   else
  2098.     cur_user.money-=howmuch;
  2099.   od_control.od_update_status_now=TRUE;
  2100. }
  2101.  
  2102.  
  2103. char
  2104. ny_get_answer(char *string)
  2105. {
  2106.   int len, cnt=0;
  2107.   time_t t,t2;
  2108.   char key,doker=TRUE;
  2109.  
  2110.  
  2111.   len=strlen(string);
  2112.   t=time(NULL);
  2113.   t2=t;
  2114.   if(strcmp(string,"YN")!=0 && no_kernel==FALSE) {
  2115.     game_events();
  2116.     doker=TRUE;
  2117.     fig_ker();
  2118.   } else
  2119.     doker=FALSE;
  2120.  
  2121.   while (1) {
  2122.     key=od_get_key(FALSE);
  2123.     while (key==NULL) {
  2124.       t=time(NULL);
  2125.       if(t>=t2+check_o_nodes) {
  2126.     if(doker)
  2127.       fig_ker();
  2128.     t2=t;
  2129.       }
  2130.  
  2131.     key=od_get_key(FALSE);
  2132.     od_sleep(0);
  2133.     }
  2134.     cnt=-1;
  2135.     while (cnt++<len) {
  2136.       if (string[cnt]==key) {
  2137.     if(doker)
  2138.       fig_ker();
  2139.     return key;
  2140.       }
  2141.     }
  2142.     cnt=-1;
  2143.     if (key>='a' && key<='z') key-=32;
  2144.     while (cnt++<len) {
  2145.       if (string[cnt]==key) {
  2146.     if(doker)
  2147.       fig_ker();
  2148.     return key;
  2149.       }
  2150.     }
  2151.   }
  2152. }
  2153.  
  2154. void
  2155. game_events(void)
  2156. {
  2157.   int intval;
  2158.   long intval2;
  2159.   char key;
  2160.  
  2161.   if(noevents) return;
  2162.  
  2163.   intval=random(100);
  2164.  
  2165.   if(intval!=50)
  2166.     return;
  2167.  
  2168.   if(!rip)
  2169.     scr_save();
  2170.  
  2171.   od_printf("\n\r\n\r");
  2172.   if(!rip) ny_clr_scr();
  2173.  
  2174.   intval=random(4)+1;
  2175.   ny_line(183,0,2);
  2176.   if(rip)
  2177.     od_get_answer("\n\r");
  2178.  
  2179.   if(intval==1) {
  2180.     if(rip) {
  2181.       od_disp_str("\n\r!|10((*Ya hear a voice ...::^M@OK))|#|#|#\n\r");
  2182.       od_get_answer("\n\r");
  2183.     }
  2184.     if(registered==FALSE) {
  2185.       ny_line(421,0,1);
  2186.     } else {
  2187.       intval=random(3)+1;
  2188.       ny_line(421+intval,0,1);
  2189.     }
  2190.     if(!rip)
  2191.       WaitForEnter();
  2192.     else
  2193.       od_get_answer("\n\r");
  2194.   } else if(intval==2) {
  2195.     ny_line(184,0,1);
  2196. //    od_printf("`bright red`Y`red`a find a rich new car ...\n\r");
  2197.     if(rip)
  2198.       od_get_answer("\n\r");
  2199.     ny_line(185,0,0);
  2200. //    od_printf("`bright red`S`red`mash it? (`bright red`Y`red`/`bright red`N`red`)");
  2201.  
  2202.     key=ny_get_answer("YN");
  2203.  
  2204.     if(!rip)
  2205.       od_printf("%c\n\r\n",key);
  2206.     else
  2207.       od_disp_str("\n\r");
  2208.     if (key=='N') {
  2209.       ny_line(189,0,1);
  2210. //      od_printf("`bright red`Y`red`a consider the risks and decide it ain't a good idea\n\r");
  2211.  
  2212.       if(!rip)
  2213.     WaitForEnter();
  2214.       else
  2215.     od_get_answer("\n\r");
  2216.       goto donewith;
  2217.     }
  2218.  
  2219.     intval=random(100);
  2220.     if (intval<=busted_ch_car) {
  2221.  
  2222. //      od_printf("\n\r\n");
  2223.       ny_send_menu(BUSTED,"");
  2224.       //od_printf("\n\r\n`bright white`BUSTED!!!! .... well the police beat the hell out of you .....");
  2225.       //od_printf("\n\rWhy don't you try again tomorrow...\n\r");
  2226.       //od_printf("Ya lost 2%c of yer points!\n\r",37);
  2227.  
  2228.       cur_user.alive=UNCONCIOUS;
  2229.       points_loose(cur_user.points*.02);
  2230.       news_post("busting up a car",cur_user.name,"",2);
  2231.       if(!rip)
  2232.     WaitForEnter();
  2233.       else
  2234.     od_get_answer("\n\r");
  2235.       od_exit(10,FALSE);
  2236.     } else {
  2237.       intval=random(100);
  2238.       if(intval<=success_ch_car) {
  2239.  
  2240.     ny_line(192,0,1);
  2241.     //od_printf("\n\r\n`bright red`Y`red`ou totally smashed that car .... a very nice job...\n\r");
  2242.     if(rip)
  2243.       od_get_answer("\n\r");
  2244.     ny_line(117,0,0);
  2245.     od_printf("%s",D_Num((long)(25*cur_user.level+25) * (long)DrgPtsCoef()));
  2246.  
  2247.     points_raise((long)25 * cur_user.level+25);
  2248.     if(!rip) {
  2249.       od_disp_str("\n\r");
  2250.       WaitForEnter();
  2251.     } else {
  2252.       od_disp_str("::^M@OK))|#|#|#\n\r");
  2253.       od_get_answer("\n\r");
  2254.     }
  2255.     goto donewith;
  2256.       } else {
  2257.  
  2258.     ny_line(406,0,1);
  2259.  
  2260.     if(!rip)
  2261.       WaitForEnter();
  2262.     else
  2263.       od_get_answer("\n\r");
  2264.     goto donewith;
  2265.       }
  2266.     }
  2267.   } else if(intval==3) {
  2268.     ny_line(425,0,0);
  2269.     key=ny_get_answer("YN");
  2270.     if(!rip)
  2271.       od_printf("%c\n\r\n",key);
  2272.     else
  2273.       od_disp_str("\n\r");
  2274.     if(key=='Y') {
  2275.       intval=random(2)+1;
  2276.       if(intval==1) {
  2277.     intval2=randomf(40*pow(1.5,(double)cur_user.level));
  2278.     ny_line(426,0,0);
  2279.     od_printf(D_Num(intval));
  2280.     ny_line(427,0,0);
  2281.     key=ny_get_answer("YN");
  2282.     if(!rip)
  2283.       od_printf("%c\n\r\n",key);
  2284.     else
  2285.       od_disp_str("\n\r");
  2286.     if (key=='N') {
  2287.       ny_line(189,0,1);
  2288.       if(!rip)
  2289.         WaitForEnter();
  2290.       else
  2291.         od_get_answer("\n\r");
  2292.       goto donewith;
  2293.     }
  2294.     intval=random(3);
  2295.     if (intval==0) {
  2296.       ny_line(430,0,1);
  2297.       if(rip)
  2298.         od_get_answer("\n\r");
  2299.       ny_line(431,0,1);
  2300.       money_minus(cur_user.money);
  2301.       cur_user.hitpoints=1;
  2302.       wrt_sts();
  2303.       if(!rip)
  2304.         WaitForEnter();
  2305.       else
  2306.         od_get_answer("\n\r");
  2307.       goto donewith;
  2308.     }
  2309.     ny_line(429,0,1);
  2310.     money_plus(intval2);
  2311.     points_raise((10 * cur_user.level) + 10);
  2312.     if(!rip)
  2313.       WaitForEnter();
  2314.     else
  2315.       od_get_answer("\n\r");
  2316.       } else {
  2317.     ny_line(428,0,0);
  2318.     key=ny_get_answer("YN");
  2319.     if(!rip)
  2320.       od_printf("%c\n\r\n",key);
  2321.     else
  2322.       od_disp_str("\n\r");
  2323.     if (key=='N') {
  2324.       ny_line(189,0,1);
  2325.       if(!rip)
  2326.         WaitForEnter();
  2327.       else
  2328.         od_get_answer("\n\r");
  2329.       goto donewith;
  2330.     }
  2331.     intval=random(5);
  2332.     if (intval==0) {
  2333.       ny_line(430,0,1);
  2334.       if(rip)
  2335.         od_get_answer("\n\r");
  2336.       ny_line(431,0,1);
  2337.       money_minus(cur_user.money);
  2338.       cur_user.hitpoints=1;
  2339.       wrt_sts();
  2340.       if(!rip)
  2341.         WaitForEnter();
  2342.       else
  2343.         od_get_answer("\n\r");
  2344.       goto donewith;
  2345.     }
  2346.     ny_line(429,0,1);
  2347.     if (cur_user.drug_hits<32767) cur_user.drug_hits++;
  2348.     points_raise((5 * cur_user.level) + 5);
  2349.     if(!rip)
  2350.       WaitForEnter();
  2351.     else
  2352.       od_get_answer("\n\r");
  2353.       }
  2354.     }
  2355.   } else {
  2356.     ny_line(432,0,1);
  2357.     if (cur_user.condoms<32767) cur_user.condoms++;
  2358.     if(!rip)
  2359.       WaitForEnter();
  2360.     else
  2361.       od_get_answer("\n\r");
  2362.   }
  2363.   donewith:
  2364.   if(!rip) scr_res();
  2365. }
  2366.  
  2367. unsigned long    //value input system
  2368. get_val(unsigned long def, unsigned long max)
  2369. {
  2370.     char input_s[30];
  2371.     unsigned long intval=0;
  2372.     int cnt=0;
  2373.  
  2374.  
  2375.     uplneZnova:;
  2376.     strset(input_s,' ');
  2377.     input_s[0]= od_get_answer("0123456789M>\n\r");
  2378.     if (input_s[0]=='M' || input_s[0]=='>') {
  2379.       od_printf("%lu\n\r",max);
  2380.       return max;
  2381.     } else if (input_s[0]=='\n' || input_s[0]=='\r') {
  2382.       od_printf("%lu\n\r",def);
  2383.       return def;
  2384.     }
  2385.     od_printf("%c",input_s[0]);
  2386.  
  2387.     cnt=0;
  2388.     while (1) {
  2389.       if (cnt<29) cnt++; else od_printf("\b");
  2390.       input_s[cnt]=od_get_answer("0123456789>\n\r\b");
  2391.       if(input_s[cnt]=='>') {
  2392.         return max;
  2393.       } else if (input_s[cnt]=='\n' || input_s[cnt]=='\r') {
  2394.          input_s[cnt]=' ';
  2395.          sscanf(input_s,"%lu",&intval);
  2396.          if (intval>max) {
  2397.          do {od_printf("\b \b"); cnt--;} while (cnt>0);
  2398.          intval=max;
  2399.          od_printf("%lu",max);}
  2400.          od_printf("\n\r");
  2401.          break;
  2402.       }
  2403.       od_printf("%c",input_s[cnt]);
  2404.       if (input_s[cnt]=='\b') {
  2405.         od_printf(" \b");
  2406.         input_s[cnt]=' ';
  2407.         cnt--;
  2408.         input_s[cnt]=' ';
  2409.         cnt--;
  2410.         if (cnt == -1) break;
  2411.         }
  2412.       }
  2413.     if (cnt == -1) goto uplneZnova;
  2414.     return intval;
  2415. }
  2416.  
  2417.  
  2418.  
  2419.  
  2420.  
  2421. int
  2422. CheckForHandle(char handle[25])
  2423. {
  2424.   FILE *fpUserFile;
  2425.   int    user_num,
  2426.     ret_val;
  2427.   char numstr[25],numstr2[25];
  2428.   user_rec urec;
  2429.   scr_rec srec;
  2430.  
  2431.   ny_un_emu(handle,numstr);
  2432.   ret_val=FALSE;
  2433.   ch_game_d();
  2434.   fpUserFile = ShareFileOpen(SCR_FILENAME, "rb");
  2435.   if(fpUserFile == NULL) {
  2436.     fpUserFile = ShareFileOpen(USER_FILENAME, "rb");
  2437.     if(fpUserFile == NULL) {
  2438.  
  2439.       if(rip) ny_clr_scr();
  2440.       od_printf("\n\r\nUnable to access the user files ... Exitting ...");
  2441.       //
  2442.       od_exit(12,FALSE);
  2443.     }
  2444.     /* Begin with the current user record number set to 0. */
  2445.     user_num = 0;
  2446.     /* Loop for each record in the file */
  2447.     while(ny_fread(&urec, sizeof(user_rec), 1, fpUserFile) == 1) {
  2448.       /* If name in record matches the current user name ... */
  2449.       if(stricmp(ny_un_emu(urec.name,numstr2), numstr) == 0) {
  2450.     /* ... then record that we have found the user's record, */
  2451.     ret_val = TRUE;
  2452.     ny_line(168,1,1);
  2453. //    od_printf("\n\r\n`bright`Sorry that name is already in use ... choose a different one...\n\r");
  2454.     if(!rip)
  2455.       WaitForEnter();
  2456.     else
  2457.       od_get_answer("\n\r");
  2458.     /* and exit the loop. */
  2459.     break;
  2460.       }
  2461.       /* Move user record number to next user record. */
  2462.       user_num++;
  2463. //      time_slice();
  2464.     }
  2465.     fclose(fpUserFile);
  2466.     return ret_val;
  2467.   } else {
  2468.     /* Begin with the current user record number set to 0. */
  2469.     user_num = 0;
  2470.     /* Loop for each record in the file */
  2471.     while(ny_fread(&srec, sizeof(scr_rec), 1, fpUserFile) == 1) {
  2472.       /* If name in record matches the current user name ... */
  2473.       if(stricmp(ny_un_emu(srec.name,numstr2), numstr) == 0) {
  2474.     /* ... then record that we have found the user's record, */
  2475.     ret_val = TRUE;
  2476.     ny_line(168,1,1);
  2477. //    od_printf("\n\r\n`bright`Sorry that name is already in use ... choose a different one...\n\r");
  2478.     if(!rip)
  2479.       WaitForEnter();
  2480.     else
  2481.       od_get_answer("\n\r");
  2482.     /* and exit the loop. */
  2483.     break;
  2484.       }
  2485.       /* Move user record number to next user record. */
  2486.       user_num++;
  2487.     }
  2488.     fclose(fpUserFile);
  2489.     return ret_val;
  2490.  
  2491.  
  2492.   }
  2493. }
  2494.  
  2495.  
  2496.  
  2497.  
  2498.  
  2499.  
  2500. /* The ReadOrAddCurrentUser() function is used by NY2008 to search the    */
  2501. /* NY2008 user file for the record containing information on the user who */
  2502. /* is currently using the door. If this is the first time that the user   */
  2503. /* has used this door, then their record will not exist in the user file. */
  2504. /* In this case, this function will add a new record for the current      */
  2505. /* user. This function returns TRUE on success, or FALSE on failure.      */
  2506. int ReadOrAddCurrentUser(void)
  2507. {
  2508.    FILE *fpUserFile;
  2509.    FILE *scr_file;
  2510.    int bGotUser = FALSE;
  2511. //   ffblk ffblk;
  2512.    char key;
  2513.    char handle[25];
  2514.    scr_rec scr_user;
  2515.  
  2516.    /* Attempt to open the user file for exclusize access by this node.     */
  2517.    /* This function will wait up to the pre-set amount of time (as defined */
  2518.    /* near the beginning of this file) for access to the user file.        */
  2519.  
  2520.  nCurrentUserNumber=0;
  2521.  ch_game_d();
  2522.  if (findfirst(USER_FILENAME,&fff,0)==0) {
  2523.    fpUserFile = ShareFileOpen(USER_FILENAME, "a+b");
  2524.  
  2525.  
  2526.    /* If unable to open user file, return with failure. */
  2527.    if(fpUserFile == NULL)
  2528.       return FALSE;
  2529.  
  2530.    /* Begin with the current user record number set to 0. */
  2531.    fseek(fpUserFile, (long)0, SEEK_SET);
  2532.  //  nCurrentUserNumber = 0; nahore se to ted dela^^^^^
  2533.  
  2534.    /* Loop for each record in the file */
  2535.    while(ny_fread(&cur_user, sizeof(user_rec), 1, fpUserFile) == 1)
  2536.    {
  2537.       /* If name in record matches the current user name ... */
  2538.       if(strcmp(cur_user.bbsname, od_control.user_name) == 0)
  2539.       {
  2540.      /* ... then record that we have found the user's record, */
  2541.      bGotUser = TRUE;
  2542.  
  2543.      /* and exit the loop. */
  2544.      break;
  2545.       }
  2546.  
  2547.       /* Move user record number to next user record. */
  2548.       nCurrentUserNumber++;
  2549.       od_kernal();
  2550.    }
  2551.  
  2552.    /* Close the user file to allow other nodes to access it. */
  2553.    fclose(fpUserFile);
  2554.  } //else {
  2555.  
  2556. // }
  2557.    /* If the user was not found in the file, attempt to add them as a */
  2558.    /* new user if the user file is not already full.                  */
  2559.    if(!bGotUser && nCurrentUserNumber < MAX_USERS)
  2560.    {
  2561.       od_printf("\n\r\n");
  2562.       ny_clr_scr();
  2563. //
  2564.       ny_send_menu(NEW,"");
  2565.  
  2566. /*      od_printf("\n\r`bright red`W`red`elcome `bright red`T`red`o `bright red`N`red`ew `bright red`Y`red`ork `bright red`2008\n\r\n");
  2567.       od_printf("`bright green`T`green`his game is quite self explanatory... `bright green`T`green`hough here is yer mission...\n\r");
  2568.       od_printf("`bright green`Y`green`ou are the child of terrorism, your grandfathers could only dream of what you\n\rare about to do ");
  2569.       od_printf("...`bright green`B`green`low up `bright red`N`red`ew `bright red`Y`red`ork `green`... \n\r");
  2570.       od_printf("`bright green`F`green`or this you will need an `bright green`ATOMIC BOMB`green`...\n\r\n");
  2571.       od_printf("`bright`THIS IS THE BETA VERSION (still might have bugs I guess)... \n\r");
  2572.       od_printf("`bright red`H`red`ere are a few tips: (read the instructions anywayz!)\n\r");
  2573.       od_printf("`bright red`I`red`f you get drug addiction of an addictive drug to 100%c you die and heffta start\n\r",37);
  2574.       od_printf("over. `bright red`S`red`ame with hunger and sexual deseases ... so watch those percentages.\n\r");
  2575.       od_printf("`bright red`A`red`lso read instructions on the efects of drugs ...\n\r");
  2576.       od_printf("`bright red`O`red`ne more tip, if you don't have sex fer a while, your attack\n\r");
  2577.       od_printf("force goes down. `bright red`K`red`eep it in mind!\n\r");
  2578.       od_printf("`bright red`C`red`olors can be used in messages and in the stuff you say or namez!\n\r\n");*/
  2579.  
  2580.  
  2581.  
  2582.       ny_line(169,0,0);
  2583. //      ny_disp_emu("`9T`1his game contains violence, sex, drugs... `9Y`1a sure ya can handle that?(`9Y`1/`9N`1)");
  2584. //
  2585.       key=ny_get_answer("YN");
  2586.       od_putch(key);
  2587.       if (key=='N') {
  2588.      if(!rip) ny_clr_scr();
  2589.      ny_line(170,2,2);
  2590.      //od_printf("\n\r`bright red`N`red`ot everybody was born with a vicious mind....\n\r");
  2591.      od_exit(10,FALSE);
  2592.      }
  2593. AskAgain:;
  2594.  
  2595.       do {
  2596.  
  2597.       od_printf("\n\r\n");
  2598.       ny_clr_scr();
  2599.       if(rip) od_send_file("texti.rip");
  2600.       ny_line(171,1,2);
  2601. //      od_printf("\n\r`bright red`N`red`ow that we got through that, I'll heffta ask ya a few questions...\n\r\n");
  2602.       ny_line(172,0,0);
  2603.       //od_printf("`bright green`W`green`hat is yer name: ");
  2604. //
  2605.       od_input_str(handle,24,' ',255);
  2606.       trim(handle);
  2607.  
  2608. //      WaitForEnter();
  2609.  
  2610.       } while ((nCurrentUserNumber!=0 && CheckForHandle(handle)!=FALSE) || handle[0]==0);
  2611.  
  2612.  
  2613.  
  2614. //      WaitForEnter();
  2615.  
  2616.       strcpy(cur_user.name, handle);
  2617. //
  2618.  
  2619. //      WaitForEnter();
  2620. //
  2621.       ny_line(173,1,0);
  2622. //
  2623. //      od_printf("\n\r\n`bright red`W`red`hat is your sex (`bright red`M`red`/`bright red`F`red`):");
  2624.  
  2625. //      WaitForEnter();
  2626.  
  2627.  
  2628.       key=od_get_answer("MF");
  2629. //
  2630.       if(!rip)
  2631.         od_printf("%c\n\r\n",key);
  2632.       else
  2633.         od_disp_str("\n\r");
  2634. //
  2635.  
  2636.       if (key=='M') cur_user.sex = MALE; else cur_user.sex = FEMALE;
  2637.  
  2638.       if(!rip) ny_send_menu(NATION,"");
  2639. /*      od_printf("\n\r\n`bright red`W`red`hat are you....\n\r\n");
  2640.       od_printf("`bright green`1`green`. `bright green`H`green`eadbanger\n\r");
  2641.       od_printf("`bright green`2`green`. `bright green`H`green`ippie\n\r");
  2642.       od_printf("`bright green`3`green`. `bright green`B`green`ig `bright green`F`green`at `bright green`D`green`ude\n\r");
  2643.       od_printf("`bright green`4`green`. `bright green`C`green`rack `bright green`A`green`ddict\n\r");
  2644.       od_printf("`bright green`5`green`. `bright green`P`green`unk\n\r\n");*/
  2645.       ny_line(174,0,0);
  2646.       //od_printf("`bright red`W`red`ell? :");
  2647.       //
  2648.       key=od_get_answer("12345");
  2649.       //
  2650.       if(!rip)
  2651.         od_printf("%c\n\r\n",key);
  2652.       else
  2653.         od_disp_str("\n\r\n");
  2654.       //
  2655.  
  2656.       switch(key) {
  2657.         case '1':
  2658.           cur_user.nation = HEADBANGER; break;
  2659.         case '2':
  2660.           cur_user.nation = HIPPIE; break;
  2661.         case '3':
  2662.           cur_user.nation = BIG_FAT_DUDE; break;
  2663.         case '4':
  2664.           cur_user.nation = CRACK_ADDICT; break;
  2665.         case '5':
  2666.           cur_user.nation = PUNK; break;
  2667.       }
  2668.  
  2669.       ny_send_menu(NEW_WIN,"");
  2670.       //What do you say when you win:
  2671.       //|--------------------------------------|
  2672.       od_input_str(cur_user.say_win,40,' ',255);
  2673.  
  2674.       od_printf("\n\r\n");
  2675.       ny_send_menu(NEW_LOOSE,"");
  2676.       //What do you say when you get yer ass kicked:
  2677.       //|--------------------------------------|
  2678.       od_input_str(cur_user.say_loose,40,' ',255);
  2679.  
  2680.  
  2681.       ny_line(175,2,0);
  2682. //      od_printf("\n\r\n`bright blue`D`blue`id ya enter all that stuff correctly?(`bright blue`Y`blue`/`bright blue`N`blue`)");
  2683.       key=ny_get_answer("YN");
  2684.       if(!rip) od_putch(key);
  2685.       if (key=='N') goto AskAgain;
  2686.  
  2687.     strcpy(cur_user.bbsname, od_control.user_name);
  2688.  
  2689. /*tady se potrebuje initializovat user*/
  2690. //
  2691.     ny_line(176,2,2);
  2692. //    od_printf("`bright blue`\n\r\nResetting User Record....\n\r\n");
  2693.  
  2694.     cur_user.level=0;
  2695.     cur_user.points=0;
  2696.     cur_user.alive=ALIVE;
  2697.     cur_user.turns=max_fights;
  2698.     cur_user.hunger=0;
  2699.     cur_user.hitpoints=cur_user.maxhitpoints=15;
  2700.  
  2701.     if (cur_user.nation==HEADBANGER){
  2702.       cur_user.strength=5;
  2703.       cur_user.defense=4;
  2704.       cur_user.throwing_ability=10;
  2705.       cur_user.punch_ability=10;
  2706.       cur_user.kick_ability=20;
  2707.     } else if (cur_user.nation==HIPPIE) {
  2708.       cur_user.strength=4;
  2709.       cur_user.defense=4;
  2710.       cur_user.throwing_ability=20;
  2711.       cur_user.punch_ability=10;
  2712.       cur_user.kick_ability=10;
  2713.     } else if (cur_user.nation==BIG_FAT_DUDE) {
  2714.       cur_user.strength=3;
  2715.       cur_user.defense=6;
  2716.       cur_user.throwing_ability=4;
  2717.       cur_user.punch_ability=18;
  2718.       cur_user.kick_ability=18;
  2719.     } else if (cur_user.nation==CRACK_ADDICT){
  2720.       cur_user.strength=4;
  2721.       cur_user.defense=5;
  2722.       cur_user.throwing_ability=14;
  2723.       cur_user.punch_ability=13;
  2724.       cur_user.kick_ability=13;
  2725.     } else if (cur_user.nation==PUNK) {
  2726.       cur_user.strength=6;
  2727.       cur_user.defense=3;
  2728.       cur_user.throwing_ability=11;
  2729.       cur_user.punch_ability=20;
  2730.       cur_user.kick_ability=11;
  2731.     }
  2732.  
  2733.     cur_user.days_not_on=0;
  2734.     cur_user.money=75;
  2735.     cur_user.bank=0;
  2736.     cur_user.arm=HANDS;
  2737.     cur_user.condoms=0;
  2738.     cur_user.since_got_laid=0;
  2739.     cur_user.sex_today=1;
  2740.     cur_user.std=NONE;
  2741.     cur_user.std_percent=0;
  2742.     cur_user.drug=POT;
  2743.     cur_user.drug_hits=0;
  2744.     cur_user.drug_addiction=0;
  2745.     cur_user.drug_high=0;
  2746.     cur_user.drug_days_since=0;
  2747.     cur_user.rank=nCurrentUserNumber;
  2748.     cur_user.rest_where=NOWHERE;
  2749.     cur_user.hotel_paid_fer=0;
  2750.     cur_user.days_in_hospital=0;
  2751.     cur_user.rocks=0;
  2752.     cur_user.InterBBSMoves=2;
  2753.     cur_user.res1=0;
  2754.     cur_user.res2=0;
  2755. //    cur_user.res3=0;
  2756. //    cur_user.res4=0;
  2757.  
  2758.     strcpy(scr_user.name,cur_user.name);
  2759.     scr_user.nation=cur_user.nation;
  2760.     scr_user.level=0;
  2761.     scr_user.points=0;
  2762.     scr_user.alive=ALIVE;
  2763.     scr_user.sex=cur_user.sex;
  2764.     scr_user.user_num=nCurrentUserNumber;
  2765.  
  2766.  
  2767.       ny_line(177,0,2);
  2768.       //od_printf("`bright blue`\n\r\nWriting to user file....\n\r\n");
  2769. //      if (bGotUser && cur_user.alive==DEAD && do_maint==FALSE)
  2770.       ch_game_d();
  2771.       fpUserFile = ShareFileOpen(USER_FILENAME, "a+b");
  2772.       scr_file = ShareFileOpen(SCR_FILENAME, "a+b");
  2773.  
  2774.  
  2775.  
  2776.       /* Write the new record to the file. */
  2777.       if(ny_fwrite(&cur_user, sizeof(user_rec), 1, fpUserFile) == 1)
  2778.       {
  2779.      /* If write succeeded, record that we now have a valid user record. */
  2780.      bGotUser = TRUE;
  2781.       }
  2782.       ny_fwrite(&scr_user, sizeof(scr_rec), 1, scr_file);
  2783.       fclose(scr_file);
  2784.       fclose(fpUserFile);
  2785.       ny_remove("SENTLIST.PL");
  2786.    }
  2787.  
  2788.    /* Return, indciating whether or not a valid user record now exists for */
  2789.    /* the user that is currently online.                                   */
  2790.    return bGotUser;
  2791. }
  2792.  
  2793.  
  2794.  
  2795. /* The WriteCurrentUser() function is called to save the information on the */
  2796. /* user who is currently using the door, to the ny2008.USR file.            */
  2797. void WriteCurrentUser(void)
  2798. {
  2799.    FILE *fpUserFile;
  2800.  
  2801.    /* Attempt to open the user file for exclusize access by this node.     */
  2802.    /* This function will wait up to the pre-set amount of time (as defined */
  2803.    /* near the beginning of this file) for access to the user file.        */
  2804.    ch_game_d();
  2805.    fpUserFile = ShareFileOpen(USER_FILENAME, "r+b");
  2806.  
  2807.    /* If unable to access the user file, display an error message and */
  2808.    /* return.                                                         */
  2809.    if(fpUserFile == NULL)
  2810.    {
  2811.       if(rip) ny_clr_scr();
  2812.       od_printf("Unable to access the user file.\n\r");
  2813.       WaitForEnter();
  2814.       return;
  2815.    }
  2816.  
  2817.    /* Move to appropriate location in user file for the current user's */
  2818.    /* record. */
  2819.    fseek(fpUserFile, (long)nCurrentUserNumber * sizeof(user_rec), SEEK_SET);
  2820.  
  2821.    /* Write the new record to the file. */
  2822.    if(ny_fwrite(&cur_user, sizeof(user_rec), 1, fpUserFile) == 0)
  2823.    {
  2824.       /* If unable to write the record, display an error message. */
  2825.       fclose(fpUserFile);
  2826.       if(rip) ny_clr_scr();
  2827.       od_printf("Unable to update your user record file.\n\r");
  2828.       WaitForEnter();
  2829.       return;
  2830.    }
  2831.  
  2832.    /* Close the user file to allow other nodes to access it again. */
  2833.    fclose(fpUserFile);
  2834. }
  2835.  
  2836. size_t
  2837. ny_fwrite(const void *ptr, size_t size, size_t n, FILE *stream)
  2838. {
  2839.   size_t status;
  2840.   long offset;
  2841.   offset=ftell(stream);
  2842.  
  2843.   if(single_node==FALSE && filelength(fileno(stream))>=offset+(size*n)) {
  2844.     //offset=ftell(stream);
  2845.  
  2846.     lock(fileno(stream),offset,size * n);
  2847.     status=fwrite(ptr,size,n,stream);
  2848.     unlock(fileno(stream),offset,size * n);
  2849.   } else {
  2850.     status=fwrite(ptr,size,n,stream);
  2851.   }
  2852.   if(!no_slices)
  2853.     time_slice();
  2854.   return status;
  2855. }
  2856.  
  2857.  
  2858. size_t
  2859. ny_fread(const void *ptr, size_t size, size_t n, FILE *stream)
  2860. {
  2861.   size_t status;
  2862.   long offset;
  2863.  
  2864.   if(single_node==FALSE && filelength(fileno(stream))>=offset+(size*n)) {
  2865.     offset=ftell(stream);
  2866.  
  2867.     lock(fileno(stream),offset,size * n);
  2868.     status=fread(ptr,size,n,stream);
  2869.     unlock(fileno(stream),offset,size * n);
  2870.   } else {
  2871.     status=fread(ptr,size,n,stream);
  2872.   }
  2873.   if(!no_slices)
  2874.     time_slice();
  2875.   return status;
  2876. }
  2877.  
  2878. /* This function opens the specified file in the specified mode for         */
  2879. /* share access by this node; while the file is open, other nodes will      */
  2880. /* be able to open the file. This function will wait for up to the number   */
  2881. /* of seconds set by FILE_ACCESS_MAX_WAIT, which is defined near the        */
  2882. /* beginning of this file.                                                  */
  2883. FILE *ShareFileOpen(char *pszFileName, char *pszMode)
  2884. {
  2885.    FILE *fpFile = NULL;
  2886.    time_t StartTime = time(NULL);
  2887.    char numstr[14];
  2888. //   ffblk ffblk;
  2889. //   ny_kernel();
  2890.  
  2891.  
  2892.    /* Attempt to open the file while there is still time remaining. */
  2893.    if(single_node==FALSE) {
  2894.      if(no_kernel==FALSE) {
  2895.        ny_kernel();
  2896.        sprintf(numstr,"u%07d.rnk",nCurrentUserNumber);
  2897.        if (findfirst(numstr,&fff,0)==0) {
  2898.      no_kernel=TRUE;
  2899.      fpFile=ShareFileOpen(numstr,"rb");
  2900.      ny_fread(&cur_user.rank,2,1,fpFile);
  2901.      no_kernel=FALSE;
  2902.      fclose(fpFile);
  2903.      ny_remove(numstr);
  2904.      wrt_sts();
  2905.        }
  2906.      }
  2907.  
  2908.      while((fpFile = _fsopen(pszFileName, pszMode,SH_DENYNO)) == NULL
  2909.     && errno == EACCES
  2910.     && difftime(time(NULL), StartTime) < FILE_ACCESS_MAX_WAIT)
  2911.      {
  2912.       /* If we were unable to open the file, call od_kernal, so that    */
  2913.       /* OpenDoors can continue to respond to sysop function keys, loss */
  2914.       /* of connection, etc.                                            */
  2915.     od_kernal();
  2916.      }
  2917.    } else {
  2918.      fpFile = fopen(pszFileName, pszMode);
  2919.    }
  2920.  
  2921.    /* Return FILE pointer for opened file, if any. */
  2922.    return fpFile;
  2923. }
  2924.  
  2925.  
  2926. FILE *ShareFileOpenAR(char *pszFileName, char *pszMode)
  2927. {
  2928.    FILE *fpFile = NULL;
  2929.    time_t StartTime = time(NULL);
  2930.    char numstr[14];
  2931. //   ffblk ffblk;
  2932. //   ny_kernel();
  2933.  
  2934.  
  2935.    /* Attempt to open the file while there is still time remaining. */
  2936.  
  2937.    if(single_node==FALSE) {
  2938.  
  2939.      if(no_kernel==FALSE) {
  2940.        ny_kernel();
  2941.        sprintf(numstr,"u%07d.rnk",nCurrentUserNumber);
  2942.        if (findfirst(numstr,&fff,0)==0) {
  2943.      no_kernel=TRUE;
  2944.      fpFile=ShareFileOpen(numstr,"rb");
  2945.      ny_fread(&cur_user.rank,2,1,fpFile);
  2946.      no_kernel=FALSE;
  2947.      fclose(fpFile);
  2948.      ny_remove(numstr);
  2949.      wrt_sts();
  2950.        }
  2951.      }
  2952.  
  2953.      while((fpFile = fopen(pszFileName, pszMode)) == NULL
  2954.     && errno == EACCES
  2955.     && difftime(time(NULL), StartTime) < FILE_ACCESS_MAX_WAIT)
  2956.      {
  2957.       /* If we were unable to open the file, call od_kernal, so that    */
  2958.       /* OpenDoors can continue to respond to sysop function keys, loss */
  2959.       /* of connection, etc.                                            */
  2960.     od_kernal();
  2961.      }
  2962.    } else {
  2963.      fpFile = fopen(pszFileName, pszMode);
  2964.  
  2965.    }
  2966.  
  2967.  
  2968.    /* Return FILE pointer for opened file, if any. */
  2969.    return fpFile;
  2970. }
  2971.  
  2972.  
  2973. int
  2974. ny_remove(char *pszFileName)
  2975. {
  2976. //   FILE *fpFile = NULL;
  2977.    time_t StartTime;
  2978. //   char numstr[80];
  2979. //   ffblk ffblk;
  2980. //   ny_kernel();
  2981.  
  2982.   if(findfirst(pszFileName,&fff,0)!=0) return 0;
  2983.  
  2984.   do {
  2985.    StartTime = time(NULL);
  2986.    /* Attempt to open the file while there is still time remaining. */
  2987.    if(single_node==FALSE) {
  2988.      while(remove(fff.ff_name) == -1
  2989.     && errno == EACCES
  2990.     && difftime(time(NULL), StartTime) < FILE_ACCESS_MAX_WAIT)
  2991.      {
  2992.       /* If we were unable to open the file, call od_kernal, so that    */
  2993.       /* OpenDoors can continue to respond to sysop function keys, loss */
  2994.       /* of connection, etc.                                            */
  2995.     od_kernal();
  2996.      }
  2997.    } else {
  2998.      remove(fff.ff_name);
  2999.    }
  3000.   } while(findnext(&fff)==0);
  3001.  
  3002.   return 1;
  3003. }
  3004.  
  3005.  
  3006.  
  3007. /* The WaitForEnter() function is used to create custom prompt */
  3008. void
  3009. WaitForEnter(void)
  3010. {
  3011.    /* Display prompt. */
  3012.  
  3013.    ny_line(1,1,0);
  3014. //   ny_disp_emu("\n\r`@Smack [ENTER] to go on.");
  3015.  
  3016.  
  3017.  
  3018.    /* Wait for a Carriage Return or Line Feed character from the user. */
  3019.    ny_get_answer("\n\r");
  3020.  
  3021.    //debug
  3022. //   od_printf("%d\n\r",nCurrentUserNumber);
  3023. //   ny_get_answer("\n\r");
  3024. }
  3025.  
  3026.  
  3027.  
  3028.  
  3029. /* CustomConfigFunction() is called by OpenDoors to process custom */
  3030. /* configuration file keywords that                                */
  3031. void CustomConfigFunction(char *pszKeyword, char *pszOptions)
  3032. {
  3033.   if(stricmp(pszKeyword, "BustedChanceBank") == 0)
  3034.   {
  3035.     sscanf(pszOptions,"%d",&busted_ch_bank);
  3036.     if (busted_ch_bank<1) busted_ch_bank=1;
  3037.     if (busted_ch_bank>90) busted_ch_bank=90;
  3038.   }
  3039.   else if(stricmp(pszKeyword, "BustedChanceFood") == 0)
  3040.   {
  3041.     sscanf(pszOptions,"%d",&busted_ch_food);
  3042.     if (busted_ch_food<1) busted_ch_food=1;
  3043.     if (busted_ch_food>90) busted_ch_food=90;
  3044.   }
  3045.   else if(stricmp(pszKeyword, "BustedChanceRape") == 0)
  3046.   {
  3047.     sscanf(pszOptions,"%d",&busted_ch_rape);
  3048.     if (busted_ch_rape<1) busted_ch_rape=1;
  3049.     if (busted_ch_rape>90) busted_ch_rape=90;
  3050.   }
  3051.   else if(stricmp(pszKeyword, "BustedChanceBeggar") == 0)
  3052.   {
  3053.     sscanf(pszOptions,"%d",&busted_ch_beggar);
  3054.     if (busted_ch_beggar<1) busted_ch_beggar=1;
  3055.     if (busted_ch_beggar>90) busted_ch_beggar=90;
  3056.   }
  3057.   else if(stricmp(pszKeyword, "BustedChanceCar") == 0)
  3058.   {
  3059.     sscanf(pszOptions,"%d",&busted_ch_car);
  3060.     if (busted_ch_car<1) busted_ch_car=1;
  3061.     if (busted_ch_car>90) busted_ch_car=90;
  3062.   }
  3063.   else if(stricmp(pszKeyword, "BustedChanceSchool") == 0)
  3064.   {
  3065.     sscanf(pszOptions,"%d",&busted_ch_school);
  3066.     if (busted_ch_school<1) busted_ch_school=1;
  3067.     if (busted_ch_school>90) busted_ch_school=90;
  3068.   }
  3069.   else if(stricmp(pszKeyword, "BustedChanceWindow") == 0)
  3070.   {
  3071.     sscanf(pszOptions,"%d",&busted_ch_window);
  3072.     if (busted_ch_window<1) busted_ch_window=1;
  3073.     if (busted_ch_window>90) busted_ch_window=90;
  3074.   }
  3075.   else if(stricmp(pszKeyword, "BustedChancePoison") == 0)
  3076.   {
  3077.     sscanf(pszOptions,"%d",&busted_ch_poison);
  3078.     if (busted_ch_poison<1) busted_ch_poison=1;
  3079.     if (busted_ch_poison>90) busted_ch_poison=90;
  3080.   }
  3081.   else if(stricmp(pszKeyword, "BustedChanceBomb") == 0)
  3082.   {
  3083.     sscanf(pszOptions,"%d",&busted_ch_bomb);
  3084.     if (busted_ch_bomb<1) busted_ch_bomb=1;
  3085.     if (busted_ch_bomb>90) busted_ch_bomb=90;
  3086.   }
  3087.   else if(stricmp(pszKeyword, "SuccessChanceBank") == 0)
  3088.   {
  3089.     sscanf(pszOptions,"%d",&success_ch_bank);
  3090.     if (success_ch_bank<1) success_ch_bank=1;
  3091.     if (success_ch_bank>100) success_ch_bank=100;
  3092.   }
  3093.   else if(stricmp(pszKeyword, "SuccessChanceFood") == 0)
  3094.   {
  3095.     sscanf(pszOptions,"%d",&success_ch_food);
  3096.     if (success_ch_food<1) success_ch_food=1;
  3097.     if (success_ch_food>100) success_ch_food=100;
  3098.   }
  3099.   else if(stricmp(pszKeyword, "SuccessChanceRape") == 0)
  3100.   {
  3101.     sscanf(pszOptions,"%d",&success_ch_rape);
  3102.     if (success_ch_rape<1) success_ch_rape=1;
  3103.     if (success_ch_rape>100) success_ch_rape=100;
  3104.   }
  3105.   else if(stricmp(pszKeyword, "SuccessChanceBeggar") == 0)
  3106.   {
  3107.     sscanf(pszOptions,"%d",&success_ch_beggar);
  3108.     if (success_ch_beggar<1) success_ch_beggar=1;
  3109.     if (success_ch_beggar>100) success_ch_beggar=100;
  3110.   }
  3111.   else if(stricmp(pszKeyword, "SuccessChanceCar") == 0)
  3112.   {
  3113.     sscanf(pszOptions,"%d",&success_ch_car);
  3114.     if (success_ch_car<1) success_ch_car=1;
  3115.     if (success_ch_car>100) success_ch_car=100;
  3116.   }
  3117.   else if(stricmp(pszKeyword, "SuccessChanceSchool") == 0)
  3118.   {
  3119.     sscanf(pszOptions,"%d",&success_ch_school);
  3120.     if (success_ch_school<1) success_ch_school=1;
  3121.     if (success_ch_school>100) success_ch_school=100;
  3122.   }
  3123.   else if(stricmp(pszKeyword, "SuccessChanceWindow") == 0)
  3124.   {
  3125.     sscanf(pszOptions,"%d",&success_ch_window);
  3126.     if (success_ch_window<1) success_ch_window=1;
  3127.     if (success_ch_window>100) success_ch_window=100;
  3128.   }
  3129.   else if(stricmp(pszKeyword, "SuccessChancePoison") == 0)
  3130.   {
  3131.     sscanf(pszOptions,"%d",&success_ch_poison);
  3132.     if (success_ch_poison<1) success_ch_poison=1;
  3133.     if (success_ch_poison>100) success_ch_poison=100;
  3134.   }
  3135.   else if(stricmp(pszKeyword, "SuccessChanceBomb") == 0)
  3136.   {
  3137.     sscanf(pszOptions,"%d",&success_ch_bomb);
  3138.     if (success_ch_bomb<1) success_ch_bomb=1;
  3139.     if (success_ch_bomb>100) success_ch_bomb=100;
  3140.   }
  3141.   else if(stricmp(pszKeyword, "FightsPerDay") == 0)
  3142.   {
  3143.     sscanf(pszOptions,"%d",&max_fights);
  3144.     if (max_fights<0) max_fights=0;
  3145.     if (max_fights>800) max_fights=800;
  3146.   }
  3147.   else if(stricmp(pszKeyword, "MaintExec") == 0)
  3148.   {
  3149.     strcpy(maint_exec,pszOptions);
  3150.   }
  3151.   else if(stricmp(pszKeyword, "RegCreditTo") == 0)
  3152.   {
  3153.     strncpy(rec_credit,pszOptions,35);
  3154.   }
  3155.   else if(stricmp(pszKeyword, "SingleNodeOnly") == 0)
  3156.   {
  3157.     single_node=TRUE;
  3158.   }
  3159.   else if(stricmp(pszKeyword, "NoMultitasker") == 0)
  3160.   {
  3161.     no_slices=TRUE;
  3162.   }
  3163.   else if(stricmp(pszKeyword, "DeleteAfter") == 0)
  3164.   {
  3165.     sscanf(pszOptions,"%d",&delete_after);
  3166.     if (delete_after<5) delete_after=5;
  3167.     if (delete_after>800) delete_after=800;
  3168.   }
  3169.   else if(stricmp(pszKeyword, "PollingValue") == 0)
  3170.   {
  3171.     sscanf(pszOptions,"%d",&time_slice_value);
  3172.     if (time_slice_value<0) time_slice_value=0;
  3173.     if (time_slice_value>2000) time_slice_value=2000;
  3174.   }
  3175.   else if(stricmp(pszKeyword, "CheckFlagsEvery") == 0)
  3176.   {
  3177.     sscanf(pszOptions,"%d",&check_o_nodes);
  3178.     if (check_o_nodes<1) check_o_nodes=1;
  3179.     if (check_o_nodes>60) check_o_nodes=60;
  3180.   }
  3181.     else if(stricmp(pszKeyword, "BankInterest") == 0)
  3182.   {
  3183.     sscanf(pszOptions,"%d",&bank_interest);
  3184.     if (bank_interest<0) bank_interest=0;
  3185.     if (bank_interest>100) bank_interest=100;
  3186.   }
  3187.   else if(stricmp(pszKeyword, "AnsiScores") == 0)
  3188.   {
  3189.     strcpy(ansi_name,pszOptions);
  3190.   }
  3191.   else if(stricmp(pszKeyword, "AsciiScores") == 0)
  3192.   {
  3193.     strcpy(ascii_name,pszOptions);
  3194.   }
  3195.   else if(stricmp(pszKeyword, "NoScoreFiles") == 0)
  3196.   {
  3197.     do_scr_files=FALSE;
  3198.   }
  3199.   else if(stricmp(pszKeyword, "FlagDirectory") == 0)
  3200.   {
  3201.     strupr(pszOptions);
  3202.  
  3203.     flagdisk=(*pszOptions) - 'A';
  3204.  
  3205.     strzcpy(flagdir,pszOptions,2,MAXDIR);
  3206.   }
  3207.   else if(stricmp(pszKeyword, "InterBBS") == 0)
  3208.   {
  3209.     ibbs=TRUE;
  3210.   }
  3211.   else if(stricmp(pszKeyword, "InterBBSOperator") == 0)
  3212.   {
  3213.     ibbs_operator=TRUE;
  3214.   }
  3215.   else if(stricmp(pszKeyword, "InterBBSGameNumber") == 0)
  3216.   {
  3217.     sscanf(pszOptions,"%d",&ibbs_game_num);
  3218.   }
  3219.  
  3220. }
  3221.  
  3222. void
  3223. nyr_disp_emu(char line[])
  3224. {
  3225.   int cnt,intval;
  3226.   FILE *justfile;
  3227.  
  3228.   for(cnt=0;line[cnt]!=0;cnt++) {
  3229.     if(line[cnt]=='`') {
  3230.       cnt++;
  3231.       if(line[cnt]==0)
  3232.     return;
  3233.       else if(line[cnt]=='`')
  3234.     od_putch('`');
  3235.       else if(line[cnt]=='v')
  3236.     od_printf(ver);
  3237.       else if(line[cnt]=='w')
  3238.     od_printf(verinfo);
  3239.       else if(line[cnt]=='r') {
  3240.     if(registered==TRUE) {
  3241.       od_printf("%ce%cistere%c to %s",'R','g','d',od_control.system_name);
  3242.     } else {
  3243.       od_printf("%cN%cE%cISTERE%c",'U','R','G','D');
  3244.     }
  3245.       } else if(line[cnt]=='d') {
  3246.     ch_game_d();
  3247.     justfile=ShareFileOpen("NYGAME.DAY","rb");
  3248.     ny_fread(&intval,2,1,justfile);
  3249.     fclose(justfile);
  3250.     od_printf("%d",intval);
  3251.       } else if(line[cnt]=='h')
  3252.     od_printf("%s",D_Num(cur_user.hitpoints));
  3253.       else if(line[cnt]=='m')
  3254.     od_printf("%s",D_Num(cur_user.money));
  3255.       else if(line[cnt]=='f')
  3256.     od_printf("%d",(int)cur_user.turns);
  3257.       else if(line[cnt]=='p')
  3258.     od_printf("%s",D_Num(cur_user.points));
  3259.     } else if (line[cnt]==9) {
  3260.       od_printf("        ");
  3261.     } else {
  3262.       od_putch(line[cnt]);
  3263.     }
  3264.   }
  3265. }
  3266.  
  3267.  
  3268.  
  3269. void
  3270. ny_disp_emu(char line[])
  3271. {
  3272.   int cnt;
  3273. //  if(rip) {
  3274. //    od_control.user_rip=FALSE;
  3275.  
  3276.   for(cnt=0;line[cnt]!=0;cnt++) {
  3277.     if(line[cnt]=='`') {
  3278.       cnt++;
  3279.       if(!rip) {
  3280.     if(line[cnt]==0)
  3281.       return;
  3282.     else if(line[cnt]=='`')
  3283.       od_putch('`');
  3284.     else if(line[cnt]=='v')
  3285.       od_printf(ver);
  3286.     else if(line[cnt]=='w')
  3287.       od_printf(verinfo);
  3288.     else if(line[cnt]=='0')
  3289.       od_set_attrib(0x0a);
  3290.     else if(line[cnt]=='1')
  3291.       od_set_attrib(0x01);
  3292.     else if(line[cnt]=='2')
  3293.       od_set_attrib(0x02);
  3294.     else if(line[cnt]=='3')
  3295.       od_set_attrib(0x03);
  3296.     else if(line[cnt]=='4')
  3297.       od_set_attrib(0x04);
  3298.     else if(line[cnt]=='5')
  3299.       od_set_attrib(0x05);
  3300.     else if(line[cnt]=='6')
  3301.       od_set_attrib(0x06);
  3302.     else if(line[cnt]=='7')
  3303.       od_set_attrib(0x07);
  3304.     else if(line[cnt]=='8')
  3305.       od_set_attrib(0x08);
  3306.     else if(line[cnt]=='9')
  3307.       od_set_attrib(0x09);
  3308.     else if(line[cnt]=='!')
  3309.       od_set_attrib(0x0b);
  3310.     else if(line[cnt]=='@')
  3311.       od_set_attrib(0x0c);
  3312.     else if(line[cnt]=='#')
  3313.       od_set_attrib(0x0d);
  3314.     else if(line[cnt]=='$')
  3315.       od_set_attrib(0x0e);
  3316.     else if(line[cnt]=='%')
  3317.       od_set_attrib(0x0f);
  3318.       } else {
  3319.     if(line[cnt]==0)
  3320.       return;
  3321.     else if(line[cnt]=='`')
  3322.       od_putch('`');
  3323.     else if(line[cnt]=='v')
  3324.       od_printf(ver);
  3325.     else if(line[cnt]=='w')
  3326.       od_printf(verinfo);
  3327.     else if(line[cnt]=='0')
  3328.       od_disp_emu("",TRUE);
  3329.     else if(line[cnt]=='1')
  3330.       od_disp_emu("",TRUE);
  3331.     else if(line[cnt]=='2')
  3332.       od_disp_emu("",TRUE);
  3333.     else if(line[cnt]=='3')
  3334.       od_disp_emu("",TRUE);
  3335.     else if(line[cnt]=='4')
  3336.       od_disp_emu("",TRUE);
  3337.     else if(line[cnt]=='5')
  3338.       od_disp_emu("",TRUE);
  3339.     else if(line[cnt]=='6')
  3340.       od_disp_emu("",TRUE);
  3341.     else if(line[cnt]=='7')
  3342.       od_disp_emu("",TRUE);
  3343.     else if(line[cnt]=='8')
  3344.       od_disp_emu("",TRUE);
  3345.     else if(line[cnt]=='9')
  3346.       od_disp_emu("",TRUE);
  3347.     else if(line[cnt]=='!')
  3348.       od_disp_emu("",TRUE);
  3349.     else if(line[cnt]=='@')
  3350.       od_disp_emu("",TRUE);
  3351.     else if(line[cnt]=='#')
  3352.       od_disp_emu("",TRUE);
  3353.     else if(line[cnt]=='$')
  3354.       od_disp_emu("",TRUE);
  3355.     else if(line[cnt]=='%')
  3356.       od_disp_emu("",TRUE);
  3357.       }
  3358.     } else if (line[cnt]==9) {
  3359.       od_printf("        ");
  3360.     } else {
  3361.       od_putch(line[cnt]);
  3362.     }
  3363.   }
  3364. //  if(rip) od_control.user_rip=TRUE;
  3365.   od_kernal();
  3366. }
  3367.  
  3368.  
  3369. void
  3370. ny_disp_emu(char line[],int min)
  3371. {
  3372.   int cnt;
  3373.   int len;
  3374.  
  3375.   len=0;
  3376.  
  3377.   //od_control.user_rip=FALSE;
  3378.  
  3379.   for(cnt=0;line[cnt]!=0 && len<min;cnt++) {
  3380.     if(line[cnt]=='`') {
  3381.       cnt++;
  3382.       if(!rip) {
  3383.     if(line[cnt]==0)
  3384.       return;
  3385.     else if(line[cnt]=='`') {
  3386.       od_putch('`');
  3387.       len++;
  3388.     } else if(line[cnt]=='v') {
  3389.       od_printf(ver);
  3390.       len+=(strlen(ver) - 1);
  3391.     } else if(line[cnt]=='w') {
  3392.       od_printf(verinfo);
  3393.       len+=(strlen(verinfo) - 1);
  3394.     } else if(line[cnt]=='0')
  3395.       od_set_attrib(0x0a);
  3396.     else if(line[cnt]=='1')
  3397.       od_set_attrib(0x01);
  3398.     else if(line[cnt]=='2')
  3399.       od_set_attrib(0x02);
  3400.     else if(line[cnt]=='3')
  3401.       od_set_attrib(0x03);
  3402.     else if(line[cnt]=='4')
  3403.       od_set_attrib(0x04);
  3404.     else if(line[cnt]=='5')
  3405.       od_set_attrib(0x05);
  3406.     else if(line[cnt]=='6')
  3407.       od_set_attrib(0x06);
  3408.     else if(line[cnt]=='7')
  3409.       od_set_attrib(0x07);
  3410.     else if(line[cnt]=='8')
  3411.       od_set_attrib(0x08);
  3412.     else if(line[cnt]=='9')
  3413.       od_set_attrib(0x09);
  3414.     else if(line[cnt]=='!')
  3415.       od_set_attrib(0x0b);
  3416.     else if(line[cnt]=='@')
  3417.       od_set_attrib(0x0c);
  3418.     else if(line[cnt]=='#')
  3419.       od_set_attrib(0x0d);
  3420.     else if(line[cnt]=='$')
  3421.       od_set_attrib(0x0e);
  3422.     else if(line[cnt]=='%')
  3423.       od_set_attrib(0x0f);
  3424.       } else {
  3425.     if(line[cnt]==0)
  3426.       return;
  3427.     else if(line[cnt]=='`') {
  3428.       od_putch('`');
  3429.       len++;
  3430.     } else if(line[cnt]=='v') {
  3431.       od_printf(ver);
  3432.       len+=(strlen(ver) - 1);
  3433.     } else if(line[cnt]=='w') {
  3434.       od_printf(verinfo);
  3435.       len+=(strlen(verinfo) - 1);
  3436.     } else if(line[cnt]=='0')
  3437.       od_disp_emu("",TRUE);
  3438.     else if(line[cnt]=='1')
  3439.       od_disp_emu("",TRUE);
  3440.     else if(line[cnt]=='2')
  3441.       od_disp_emu("",TRUE);
  3442.     else if(line[cnt]=='3')
  3443.       od_disp_emu("",TRUE);
  3444.     else if(line[cnt]=='4')
  3445.       od_disp_emu("",TRUE);
  3446.     else if(line[cnt]=='5')
  3447.       od_disp_emu("",TRUE);
  3448.     else if(line[cnt]=='6')
  3449.       od_disp_emu("",TRUE);
  3450.     else if(line[cnt]=='7')
  3451.       od_disp_emu("",TRUE);
  3452.     else if(line[cnt]=='8')
  3453.       od_disp_emu("",TRUE);
  3454.     else if(line[cnt]=='9')
  3455.       od_disp_emu("",TRUE);
  3456.     else if(line[cnt]=='!')
  3457.       od_disp_emu("",TRUE);
  3458.     else if(line[cnt]=='@')
  3459.       od_disp_emu("",TRUE);
  3460.     else if(line[cnt]=='#')
  3461.       od_disp_emu("",TRUE);
  3462.     else if(line[cnt]=='$')
  3463.       od_disp_emu("",TRUE);
  3464.     else if(line[cnt]=='%')
  3465.       od_disp_emu("",TRUE);
  3466.       }
  3467.     } else if (line[cnt]==9) {
  3468.       len+=8;
  3469.       if (min-len>=8)
  3470.     od_printf("        ");
  3471.       else
  3472.     od_repeat(' ',min-len);
  3473.     } else {
  3474.       len++;
  3475.       od_putch(line[cnt]);
  3476.     }
  3477.   }
  3478. //  if(rip) od_control.user_rip=TRUE;
  3479.   od_repeat(' ',min-len);
  3480. }
  3481.  
  3482.  
  3483. char
  3484. *ny_un_emu(char line[])
  3485. {
  3486.   int cnt;
  3487.   int len;
  3488.   char *out;
  3489.  
  3490.   len=strlen(line);
  3491.  
  3492.   out=(char *)malloc(len);
  3493.  
  3494.   len=0;
  3495.  
  3496.   for(cnt=0;line[cnt]!=0;cnt++) {
  3497.     if(line[cnt]=='`') {
  3498.       cnt++;
  3499.       if(line[cnt]==0) {
  3500.     out[len]=0;
  3501.     return out;
  3502.       } else if(line[cnt]=='`') {
  3503.     out[len]='`';
  3504.     len++;
  3505.       } else if(line[cnt]=='v') {
  3506.     out[len]=0;
  3507.     strcat(out,ver);
  3508.     len+=strlen(ver);
  3509.       } else if(line[cnt]=='w') {
  3510.     out[len]=0;
  3511.     strcat(out,verinfo);
  3512.     len+=strlen(verinfo);
  3513.       }
  3514.  
  3515.     } else {
  3516.       out[len]=line[cnt];
  3517.       len++;
  3518.     }
  3519.   }
  3520.   out[len]=0;
  3521.   strcpy(line,out);
  3522.   free(out);
  3523.   return line;
  3524. }
  3525.  
  3526. char
  3527. *ny_un_emu(char line[],char out[])
  3528. {
  3529.   int cnt;
  3530.   int len;
  3531.  
  3532.   len=0;
  3533.  
  3534.   for(cnt=0;line[cnt]!=0;cnt++) {
  3535.     if(line[cnt]=='`') {
  3536.       cnt++;
  3537.       if(line[cnt]==0) {
  3538.     out[len]=0;
  3539.     return out;
  3540.       } else if(line[cnt]=='`') {
  3541.     out[len]='`';
  3542.     len++;
  3543.       } else if(line[cnt]=='v') {
  3544.     out[len]=0;
  3545.     strcat(out,ver);
  3546.     len+=strlen(ver);
  3547.       } else if(line[cnt]=='w') {
  3548.     out[len]=0;
  3549.     strcat(out,verinfo);
  3550.     len+=strlen(verinfo);
  3551.       }
  3552.  
  3553.     } else {
  3554.       out[len]=line[cnt];
  3555.       len++;
  3556.     }
  3557.   }
  3558.   out[len]=0;
  3559.   return out;
  3560. }
  3561.  
  3562.  
  3563. void
  3564. ny_disp_emu_file(FILE *ans_phile,FILE *asc_phile,char line[],int min)
  3565. {
  3566.   int cnt;
  3567.   int len;
  3568.  
  3569.   len=0;
  3570.  
  3571.   for(cnt=0;line[cnt]!=0 && len<min;cnt++) {
  3572.     if(line[cnt]=='`') {
  3573.       cnt++;
  3574.       if(line[cnt]==0) {
  3575.     while(min>len) {
  3576.       fprintf(asc_phile," ");
  3577.       fprintf(ans_phile," ");
  3578.       len++;
  3579.     }
  3580.     return;
  3581.       } else if(line[cnt]=='`') {
  3582.     fprintf(asc_phile,"`");
  3583.     fprintf(ans_phile,"`");
  3584.       } else if(line[cnt]=='v') {
  3585.     fprintf(asc_phile,ver);
  3586.     fprintf(ans_phile,ver);
  3587.     len+=(strlen(ver) - 1);
  3588.       } else if(line[cnt]=='w') {
  3589.     fprintf(asc_phile,verinfo);
  3590.     fprintf(ans_phile,verinfo);
  3591.     len+=(strlen(verinfo) - 1);
  3592.       } else if(line[cnt]=='0')
  3593.     fprintf(ans_phile,"");
  3594.       else if(line[cnt]=='1')
  3595.     fprintf(ans_phile,"");
  3596.       else if(line[cnt]=='2')
  3597.     fprintf(ans_phile,"");
  3598.       else if(line[cnt]=='3')
  3599.     fprintf(ans_phile,"");
  3600.       else if(line[cnt]=='4')
  3601.     fprintf(ans_phile,"");
  3602.       else if(line[cnt]=='5')
  3603.     fprintf(ans_phile,"");
  3604.       else if(line[cnt]=='6')
  3605.     fprintf(ans_phile,"");
  3606.       else if(line[cnt]=='7')
  3607.     fprintf(ans_phile,"");
  3608.       else if(line[cnt]=='8')
  3609.     fprintf(ans_phile,"");
  3610.       else if(line[cnt]=='9')
  3611.     fprintf(ans_phile,"");
  3612.       else if(line[cnt]=='!')
  3613.     fprintf(ans_phile,"");
  3614.       else if(line[cnt]=='@')
  3615.     fprintf(ans_phile,"");
  3616.       else if(line[cnt]=='#')
  3617.     fprintf(ans_phile,"");
  3618.       else if(line[cnt]=='$')
  3619.     fprintf(ans_phile,"");
  3620.       else if(line[cnt]=='%')
  3621.     fprintf(ans_phile,"");
  3622.     } else {
  3623.       len++;
  3624.       fprintf(asc_phile,"%c",line[cnt]);
  3625.       fprintf(ans_phile,"%c",line[cnt]);
  3626.     }
  3627.   }
  3628.   while(min>len) {
  3629.     fprintf(asc_phile," ");
  3630.     fprintf(ans_phile," ");
  3631.     len++;
  3632.   }
  3633. }
  3634.  
  3635. void
  3636. scr_save(void)
  3637. {
  3638.   if(savelevel==0) {
  3639.     if(rip) {
  3640.       od_disp_str("\n\r!|10$SAVEALL$|#|#|#\n\r");
  3641.     } else {
  3642.       t_buffer=(char *)malloc(4004);
  3643.       if(t_buffer!=NULL)
  3644.     od_save_screen(t_buffer);
  3645.     }
  3646.     savelevel=1;
  3647.   } else if(savelevel==1) {
  3648.     if(rip) {
  3649.       od_disp_str("\n\r!|10$SAVE0$|#|#|#\n\r");
  3650.     } else {
  3651.       t_buffer1=(char *)malloc(4004);
  3652.       if(t_buffer1!=NULL)
  3653.     od_save_screen(t_buffer1);
  3654.     }
  3655.     savelevel=2;
  3656.   } else {
  3657.     savelevel++;
  3658.   }
  3659. }
  3660.  
  3661. void
  3662. scr_res(void)
  3663. {
  3664.   if(savelevel==1) {
  3665.     if(rip) {
  3666.       od_disp_str("\n\r!|10$RESTOREALL$|#|#|#\n\r  \b\b");
  3667.     } else {
  3668.       if(t_buffer!=NULL) {
  3669.     od_restore_screen(t_buffer);
  3670.     free(t_buffer);
  3671.       }
  3672.     }
  3673.     savelevel=0;
  3674.   } else if(savelevel==2) {
  3675.     if(rip) {
  3676.       od_disp_str("\n\r!|10$RESTORE0$|#|#|#\n\r  \b\b");
  3677.     } else {
  3678.       if(t_buffer1!=NULL) {
  3679.     od_restore_screen(t_buffer1);
  3680.     free(t_buffer1);
  3681.       }
  3682.     }
  3683.     savelevel=1;
  3684.   } else if(savelevel>2) {
  3685.     savelevel--;
  3686.   }
  3687. }
  3688.  
  3689. void
  3690. ch_game_d(void)
  3691. {
  3692.  if(c_dir_g==1) {
  3693.    setdisk(gamedisk);
  3694.    chdir(gamedir);
  3695.    c_dir_g=0;
  3696.  }
  3697. }
  3698.  
  3699. void
  3700. ch_flag_d(void)
  3701. {
  3702.  if(c_dir_g==0) {
  3703.    setdisk(flagdisk);
  3704.    chdir(flagdir);
  3705.    c_dir_g=1;
  3706.  }
  3707. }
  3708.  
  3709.  
  3710. void
  3711. ny_clr_scr(void)
  3712. {
  3713.  if(rip) {
  3714.    od_control.user_rip=FALSE;
  3715.    od_disp_str("\n\r!|*|#|#|#\n\r");
  3716.    od_clr_scr();
  3717.    od_control.user_rip=TRUE;
  3718.    od_printf("\r\r");
  3719.    od_kernal();
  3720.  } else {
  3721.    od_clr_scr();
  3722.  }
  3723. // if(rip) od_disp_str("\n\r\n\r");
  3724. }
  3725.  
  3726. int
  3727. ibbs_bbs_list(void)
  3728. {
  3729.   int cnt,cnt2,mine;
  3730.   int nonstop=FALSE;
  3731.   char numstr[4],key;
  3732.  
  3733.   if(ibbs==FALSE || IBBSInfo.paOtherSystem==NULL || IBBSInfo.nTotalSystems==0)
  3734.     return -1;
  3735.  
  3736.   if(rip) {
  3737.     od_send_file("FRAME.RIP");
  3738.     od_send_file("FRAME3.RIP");
  3739.   } else {
  3740.     od_disp_str("\n\r\n\r");
  3741.     ny_clr_scr();
  3742.   }
  3743.  
  3744.   ny_send_menu(LIST_IB_SYS,"");
  3745.  
  3746.   cnt2=5;
  3747.   for(cnt=0;cnt<IBBSInfo.nTotalSystems;cnt++) {
  3748.     if(strcmp(IBBSInfo.szThisNodeAddress,IBBSInfo.paOtherSystem[cnt].szAddress)==0) {
  3749.       mine=cnt;
  3750.     } else {
  3751.       od_printf("`bright`%d - `bright green`%s `dark green`%.32s\n\r",cnt,IBBSInfo.paOtherSystem[cnt].szSystemName,IBBSInfo.paOtherSystem[cnt].szLocation);
  3752.       cnt2++;
  3753.       if (nonstop==FALSE && cnt2%od_control.user_screen_length==0) {
  3754.     ny_disp_emu("`%More (Y/n/=)");
  3755.     key=ny_get_answer("YN=\n\r");
  3756.     od_printf("\r            \r");
  3757.     cnt2=2;
  3758.     if(key=='N')
  3759.       break;
  3760.     else if(key=='=')
  3761.       nonstop=TRUE;
  3762.       }
  3763.     }
  3764.   }
  3765.  
  3766.   if(rip) od_send_file("FRAME.RIP");
  3767.  
  3768.   do {
  3769.     ny_line(448,1,0);
  3770.     od_input_str(numstr,3,'0','9');
  3771.     if(numstr[0]==0)
  3772.       return -1;
  3773.     sscanf(numstr,"%d",&cnt);
  3774.     od_disp_str("\n\r");
  3775.   } while(cnt>=IBBSInfo.nTotalSystems || cnt==mine);
  3776.  
  3777.   return cnt;
  3778. }
  3779.  
  3780. void
  3781. ibbs_bbs_scores(void)
  3782. {
  3783.   int cnt,cnt2;
  3784.   int nonstop=FALSE;
  3785.   ibbs_bbs_spy_rec bbs_spy_rec;
  3786.   scr_rec srec;
  3787.   long filepos;
  3788.   FILE *justfile,*jfile;
  3789.   char key;
  3790.  
  3791.   if(ibbs==FALSE || IBBSInfo.paOtherSystem==NULL || IBBSInfo.nTotalSystems==0)
  3792.     return;
  3793.  
  3794.  
  3795.   justfile=ShareFileOpen("NYIBBS.SPY","rb");
  3796.   if(justfile==NULL) {
  3797.     ny_line(450,2,1);
  3798.     WaitForEnter();
  3799.     return;
  3800.   }
  3801.  
  3802.   if(rip) {
  3803.     od_send_file("FRAME.RIP");
  3804.     od_send_file("FRAME3.RIP");
  3805.   } else {
  3806.     od_disp_str("\n\r\n\r");
  3807.     ny_clr_scr();
  3808.   }
  3809.  
  3810.   ny_send_menu(LIST_IB_SYS,"");
  3811.   ny_line(453,0,1);
  3812.  
  3813.   cnt2=5;
  3814.   while(ny_fread(&bbs_spy_rec,sizeof(ibbs_bbs_spy_rec),1,justfile)==1) {
  3815.     for(cnt=0;cnt<IBBSInfo.nTotalSystems;cnt++) {
  3816.       if(strcmp(bbs_spy_rec.node,IBBSInfo.paOtherSystem[cnt].szAddress)==0) {
  3817.     if(strcmp(bbs_spy_rec.node,IBBSInfo.szThisNodeAddress)==0) {
  3818.       jfile=ShareFileOpen(SCR_FILENAME,"rb");
  3819.       ny_fread(&srec,sizeof(scr_rec),1,jfile);
  3820.       fclose(jfile);
  3821.       od_printf("`bright green`%-40s `dark green`%s\n\r",IBBSInfo.paOtherSystem[cnt].szSystemName,D_Num(srec.points));
  3822.     } else {
  3823.       od_printf("`bright green`%-40s `dark green`%s\n\r",IBBSInfo.paOtherSystem[cnt].szSystemName,D_Num(bbs_spy_rec.hi_points));
  3824.       break;
  3825.     }
  3826.       }
  3827.     }
  3828.     cnt2++;
  3829.     if (nonstop==FALSE && cnt2%od_control.user_screen_length==0) {
  3830.       filepos=ftell(justfile);
  3831.       fclose(justfile);
  3832.       ny_disp_emu("`%More (Y/n/=)");
  3833.       key=ny_get_answer("YN=\n\r");
  3834.       od_printf("\r            \r");
  3835.       cnt2=1;
  3836.       justfile=ShareFileOpen("NYIBBS.SPY","rb");
  3837.       fseek(justfile,filepos,SEEK_SET);
  3838.       if(key=='N')
  3839.     break;
  3840.       else if(key=='=')
  3841.     nonstop=TRUE;
  3842.     }
  3843.   }
  3844.   fclose(justfile);
  3845.   if(rip) od_send_file("FRAME1.RIP");
  3846.   WaitForEnter();
  3847. }
  3848.  
  3849.  
  3850. void
  3851. ibbs_bbs_name(int bbs,int sex,int nochoice,char nameI[],int *dbn,int *pn)
  3852. {
  3853.   FILE *justfile;
  3854.   ibbs_bbs_spy_rec bbs_spy_rec;
  3855.   ibbs_scr_rec ibscr_rec;
  3856.   int cnt,nonstop=FALSE;
  3857.   int cnt2;
  3858.   char numstr[26];
  3859.   long filepos;
  3860.   char key;
  3861.   nameI[0]=0;
  3862.  
  3863.   *dbn=0;
  3864.   *pn=-1;
  3865.  
  3866.   justfile=ShareFileOpen("NYIBBS.SPY","rb");
  3867.   if(justfile==NULL) {
  3868.     ny_line(450,0,1);
  3869.     WaitForEnter();
  3870.     return;
  3871.   }
  3872.  
  3873.   if(rip) {
  3874.     od_send_file("FRAME.RIP");
  3875.     od_send_file("FRAME3.RIP");
  3876.   } else {
  3877.     od_disp_str("\n\r\n\r");
  3878.     ny_clr_scr();
  3879.   }
  3880.  
  3881.   ny_line(452,1,0);
  3882.   od_disp_str(IBBSInfo.paOtherSystem[bbs].szSystemName);
  3883.   ny_line(451,2,1);
  3884.  
  3885.   while(ny_fread(&bbs_spy_rec,sizeof(ibbs_bbs_spy_rec),1,justfile)==1) {
  3886.     if(strcmp(IBBSInfo.paOtherSystem[bbs].szAddress,bbs_spy_rec.node)==0) {
  3887.       if(bbs_spy_rec.player_list!=0) {
  3888.     sprintf(numstr,"NYSPYDB.%03d",bbs_spy_rec.player_list);
  3889.     *dbn=bbs_spy_rec.player_list;
  3890.     break;
  3891.       } else {
  3892.     ny_line(450,0,1);
  3893.     WaitForEnter();
  3894.     return;
  3895.       }
  3896.     }
  3897.   }
  3898.   fclose(justfile);
  3899.  
  3900.   justfile=ShareFileOpen(numstr,"rb");
  3901.   cnt2=4;
  3902.  
  3903.   if(nochoice) {
  3904.     ny_line(457,0,1);
  3905.     cnt2++;
  3906.   }
  3907.  
  3908.   cnt=0;
  3909.   while(ny_fread(&ibscr_rec,sizeof(ibbs_scr_rec),1,justfile)==1) {
  3910.     if(sex==0 || (sex==1 && ibscr_rec.sex==FEMALE) || (sex==2 && ibscr_rec.sex==MALE)) {
  3911.       if(nochoice==FALSE) {
  3912.     od_printf("`bright`%d - `bright red`",cnt);
  3913.     ny_disp_emu(ibscr_rec.name);
  3914.     od_disp_str("\n\r");
  3915.       } else {
  3916.     if(ibscr_rec.level>=0) {
  3917.       od_set_attrib(0x0a);
  3918.       od_printf("%-2d   `bright red`",ibscr_rec.level);
  3919.       ny_disp_emu(ibscr_rec.name,25);
  3920.       od_set_attrib(0x0a);
  3921.       od_printf(" %-20s ",D_Num(ibscr_rec.points));
  3922.       if (ibscr_rec.sex==MALE) ny_disp_emu("`$M  "); else ny_disp_emu("`$F  ");
  3923.       od_set_attrib(0x09);
  3924.       switch(ibscr_rec.nation) {
  3925.         case HEADBANGER:
  3926.           od_printf("HEADBANGER   "); break;
  3927.         case HIPPIE:
  3928.           od_printf("HIPPIE       "); break;
  3929.         case BIG_FAT_DUDE:
  3930.           od_printf("BIG FAT DUDE "); break;
  3931.         case CRACK_ADDICT:
  3932.           od_printf("CRACK ADDICT "); break;
  3933.         case PUNK:
  3934.           od_printf("PUNK         "); break;
  3935.       }
  3936.     } else {
  3937.       ny_disp_emu("`@     ");
  3938.       ny_disp_emu(ibscr_rec.name,25);
  3939.       ny_disp_emu(" `%No Spy Info Available");
  3940.     }
  3941.     od_disp_str("\n\r");
  3942.       }
  3943.       cnt2++;
  3944.       if (nonstop==FALSE && cnt2%od_control.user_screen_length==0) {
  3945.     filepos=ftell(justfile);
  3946.     fclose(justfile);
  3947.     ny_disp_emu("`%More (Y/n/=)");
  3948.     key=ny_get_answer("YN=\n\r");
  3949.     od_printf("\r            \r");
  3950.     cnt2=2;
  3951.     justfile=ShareFileOpen(numstr,"rb");
  3952.     fseek(justfile,filepos,SEEK_SET);
  3953.     if(key=='N')
  3954.       break;
  3955.     else if(key=='=')
  3956.       nonstop=TRUE;
  3957.       }
  3958.     }
  3959.     cnt++;
  3960.   }
  3961.   fclose(justfile);
  3962.  
  3963.   if(nochoice==FALSE) {
  3964.     if(rip) od_send_file("FRAME.RIP");
  3965.     do {
  3966.       ny_line(449,1,0);
  3967.       od_input_str(numstr,3,'0','9');
  3968.       if(numstr[0]==0)
  3969.     return;
  3970.       sscanf(numstr,"%d",&cnt);
  3971.       od_disp_str("\n\r");
  3972.       if(sex>0 && cnt<bbs_spy_rec.players) {
  3973.     justfile=ShareFileOpen(numstr,"rb");
  3974.     fseek(justfile,cnt*sizeof(ibbs_scr_rec),SEEK_SET);
  3975.     ny_fread(&ibscr_rec,sizeof(ibbs_scr_rec),1,justfile);
  3976.     strcpy(nameI,ibscr_rec.nameI);
  3977.     fclose(justfile);
  3978.     if(sex==1 && ibscr_rec.sex==MALE)
  3979.       cnt=bbs_spy_rec.players;
  3980.     else if(sex==2 && ibscr_rec.sex==FEMALE)
  3981.       cnt=bbs_spy_rec.players;
  3982.       }
  3983.     } while(cnt>=bbs_spy_rec.players);
  3984.     justfile=ShareFileOpen(numstr,"rb");
  3985.     fseek(justfile,cnt*sizeof(ibbs_scr_rec),SEEK_SET);
  3986.     ny_fread(&ibscr_rec,sizeof(ibbs_scr_rec),1,justfile);
  3987.     strcpy(nameI,ibscr_rec.nameI);
  3988.     fclose(justfile);
  3989.     *pn=cnt;
  3990.   } else {
  3991.     if(rip) od_send_file("FRAME1.RIP");
  3992.     WaitForEnter();
  3993.   }
  3994. }
  3995.  
  3996. void
  3997. ibbs_ops(void)
  3998. {
  3999.     char key;
  4000.     char hand[36];
  4001.     char omg[51];
  4002.     char numstr[26];
  4003. //    char node_r[NODE_ADDRESS_CHARS + 1];
  4004.     char line[80],ovr[80];
  4005.     FILE *justfile;
  4006.     FILE *msg_file;
  4007.     scr_rec urec;
  4008.     user_rec u2rec;
  4009.     int unum,ret,cnt;
  4010.     ibbs_mail_type ibmail;
  4011.     ibbs_scr_rec ibscr_rec;
  4012.     long fillen;
  4013.     int dbn,pn,intval;
  4014.     ibbs_act_rec act_rec;
  4015.     unsigned long money;
  4016. //    desease ill;
  4017.  
  4018.     struct {
  4019.       char  tagline[80],
  4020.       name[25],
  4021.       name2[36];
  4022.       int   flag;
  4023.     } newzfile;
  4024.  
  4025.  
  4026.     ovr[0]=0;
  4027.     line[0]=0;
  4028.  
  4029.     do {
  4030.       key=callmenu("LSMBHIPDXAYQ?\n\r",IBBS_MENU,454,FALSE);
  4031.       while (expert>0 && key=='?') {
  4032.         expert+=10;
  4033.         key=callmenu("LSMBHIPDXAYQ?\n\r",IBBS_MENU,454,FALSE);
  4034.         expert-=10;
  4035.       }
  4036.  
  4037.       if (key=='P') {
  4038.         if(cur_user.InterBBSMoves<=0) {
  4039.           ny_line(455,2,1);
  4040.           if(rip) {
  4041.         od_get_answer("\n\r");
  4042.         no_rip_m=1;
  4043.           } else
  4044.         WaitForEnter();
  4045.         } else {
  4046.           wrt_sts();
  4047.           intval=ibbs_bbs_list();
  4048.           if(intval>-1) {
  4049.         ibbs_bbs_name(intval,0,FALSE,hand,&dbn,&pn);
  4050.         if(hand[0]!=0) {
  4051.           cur_user.InterBBSMoves--;
  4052.           sprintf(numstr,"NYSPYDB.%03d",dbn);
  4053.           justfile=ShareFileOpen(numstr,"rb");
  4054.           fseek(justfile,pn*sizeof(ibbs_scr_rec),SEEK_SET);
  4055.           ny_fread(&ibscr_rec,sizeof(ibbs_scr_rec),1,justfile);
  4056.           fclose(justfile);
  4057.  
  4058.           strcpy(act_rec.name_rI,ibscr_rec.nameI);
  4059.           strcpy(act_rec.name_sI,cur_user.bbsname);
  4060.           strcpy(act_rec.node_s,IBBSInfo.szThisNodeAddress);
  4061.           act_rec.action=1;
  4062.           sprintf(IBBSInfo.szProgName, "#@NYG#%05d ACTIONS",ibbs_game_num);
  4063.           IBSend(&IBBSInfo,IBBSInfo.paOtherSystem[intval].szAddress,(char *)&act_rec,sizeof(ibbs_act_rec));
  4064.           ny_line(456,0,1);
  4065.           if(rip)
  4066.             od_get_answer("\n\r");
  4067.           else
  4068.             WaitForEnter();
  4069.         }
  4070.           }
  4071.         }
  4072.       } else if (key=='Y') {
  4073.         DisplayStats();
  4074.         WaitForEnter();
  4075.       } else if (key=='L') {
  4076.         ibbs_bbs_scores();
  4077.       } else if (key=='S') {
  4078.         intval=ibbs_bbs_list();
  4079.         if(intval>-1) {
  4080.           ibbs_bbs_name(intval,0,FALSE,hand,&dbn,&pn);
  4081.           if(hand[0]!=0) {
  4082.         sprintf(numstr,"NYSPYDB.%03d",dbn);
  4083.         justfile=ShareFileOpen(numstr,"rb");
  4084.         fseek(justfile,pn*sizeof(ibbs_scr_rec),SEEK_SET);
  4085.         ny_fread(&ibscr_rec,sizeof(ibbs_scr_rec),1,justfile);
  4086.         fclose(justfile);
  4087.  
  4088.         ibmail.flirt=0;
  4089.         if (ibscr_rec.sex!=cur_user.sex && cur_user.sex_today>0) {
  4090.  
  4091.           ny_line(328,1,0);
  4092. //              od_printf("\n\r`bright red`A`red`sk `bright red`
  4093.           if(!rip)
  4094.             ny_disp_emu(ibscr_rec.name);
  4095.           else
  4096.             od_disp_str(ny_un_emu(ibscr_rec.name,numstr));
  4097.           ny_line(329,0,0);
  4098.             //`red` to have sex with you?(`bright red`Y`red`/`bright red`N`red`)",mail_idx.sender);
  4099.  
  4100.           key=ny_get_answer("YN");
  4101.           if(!rip)
  4102.             od_printf("%c\n\r",key);
  4103.           else
  4104.             od_disp_str("\n\r");
  4105.           if (key=='Y') {
  4106.             if (cur_user.sex_today<=0) {
  4107.  
  4108.               ny_line(118,1,1);
  4109.               //od_printf("\n\r\n\r`bright`You already used up all your sex turns today ...\n\r");
  4110.  
  4111.               WaitForEnter();
  4112.               od_printf("\n\r");
  4113.             } else {
  4114.               ibmail.flirt=1;
  4115.               cur_user.sex_today--;
  4116.             }
  4117.           }
  4118.         }
  4119.  
  4120.           /*
  4121.         ny_line(330,1,0);
  4122.         //od_printf("\n\r`bright red`Q`red`uote message? (`bright red`Y`red`/`bright red`N`red`)");
  4123.  
  4124.         key=ny_get_answer("YN");
  4125.         if(!rip)
  4126.           od_printf("%c\n\r",key);
  4127.         else
  4128.           od_disp_str("\n\r");
  4129.  
  4130.         if(key=='Y') {
  4131.           ibmail.quote_length=ibmail.length;
  4132.           for(cnt=0;cnt<10;cnt++)
  4133.             strcpy(ibmail.quote_lines[cnt],ibmail.lines[cnt]);
  4134.         } else {
  4135.           ibmail.quote_length=0;
  4136.         }*/
  4137.         ibmail.quote_length=0;
  4138.         ny_line(446,1,1);
  4139.         //od_printf("\n\r`bright red`O`red`k type yer message now (`bright red`/s`red`=save `bright red`/a`red`=abort):\n\r");
  4140.         cnt=-1;
  4141.         ovr[0]=0;
  4142.         do {
  4143.           cnt++;
  4144.           if(cnt<9) {
  4145.             get_line(ovr,ibmail.lines[cnt],ovr,TRUE);
  4146.           } else {
  4147.             get_line(ovr,ibmail.lines[cnt],ovr,FALSE);
  4148.             cnt++;
  4149.           }
  4150.         } while ((ibmail.lines[cnt][0]!='/' && ibmail.lines[cnt][1]!='S') && (ibmail.lines[cnt][0]!='/' && ibmail.lines[cnt][1]!='A') && cnt<9);
  4151.  
  4152.         if (ibmail.lines[cnt][1]=='s' || ibmail.lines[cnt][1]=='S' || cnt==9) {
  4153.           ny_line(135,0,1);
  4154. //              od_printf("\b\b`bright red`S`red`aving...\n\r");
  4155.           //cnt+=mail_idx.afterquote;
  4156.           ibmail.length=cnt;
  4157.           strcpy(ibmail.recver,ibscr_rec.name);
  4158.           strcpy(ibmail.sender,cur_user.name);
  4159.           strcpy(ibmail.node_r,IBBSInfo.paOtherSystem[intval].szAddress);
  4160.           strcpy(ibmail.node_s,IBBSInfo.szThisNodeAddress);
  4161.           strcpy(ibmail.recverI,ibscr_rec.nameI);
  4162.           strcpy(ibmail.senderI,cur_user.bbsname);
  4163.           ibmail.deleted=FALSE;
  4164.           ibmail.sender_sex=cur_user.sex;
  4165.           ibmail.ill=cur_user.std;
  4166.           ibmail.inf=cur_user.std_percent;
  4167.           sprintf(IBBSInfo.szProgName, "#@NYG#%05d MAIL",ibbs_game_num);
  4168.  
  4169.           IBSendMail(&IBBSInfo,&ibmail);
  4170.  
  4171.           //IBSend(&IBBSInfo,IBBSInfo.paOtherSystem[intval].szAddress,&ibmail,sizeof(ibbs_mail_type)-((20-ibmail.length)*81));
  4172.  
  4173.  
  4174.         } else {
  4175.           ny_line(136,0,1);
  4176.           if(ibmail.flirt==1) cur_user.sex_today++;
  4177.         }
  4178.  
  4179.         if(!rip)
  4180.           WaitForEnter();
  4181.         else
  4182.           od_get_answer("\n\r");
  4183.           }
  4184.         }
  4185.       } else if (key=='X') {
  4186.         intval=ibbs_bbs_list();
  4187.         if(intval>-1) {
  4188.           if(cur_user.sex==MALE)
  4189.         ibbs_bbs_name(intval,1,FALSE,hand,&dbn,&pn);
  4190.           else
  4191.         ibbs_bbs_name(intval,2,FALSE,hand,&dbn,&pn);
  4192.  
  4193.           if(hand[0]!=0) {
  4194.         sprintf(numstr,"NYSPYDB.%03d",dbn);
  4195.         justfile=ShareFileOpen(numstr,"rb");
  4196.         fseek(justfile,pn*sizeof(ibbs_scr_rec),SEEK_SET);
  4197.         ny_fread(&ibscr_rec,sizeof(ibbs_scr_rec),1,justfile);
  4198.         fclose(justfile);
  4199.  
  4200.         ibmail.flirt=0;
  4201.         if (ibscr_rec.sex!=cur_user.sex && cur_user.sex_today>0) {
  4202.           ibmail.flirt=1;
  4203.           cur_user.sex_today--;
  4204.           ibmail.quote_length=0;
  4205.           ny_line(134,1,1);
  4206.  
  4207.           cnt=-1;
  4208.           ovr[0]=0;
  4209.           do {
  4210.             cnt++;
  4211.             if(cnt<9) {
  4212.               get_line(ovr,ibmail.lines[cnt],ovr,TRUE);
  4213.             } else {
  4214.               get_line(ovr,ibmail.lines[cnt],ovr,FALSE);
  4215.               cnt++;
  4216.             }
  4217.           } while ((ibmail.lines[cnt][0]!='/' && ibmail.lines[cnt][1]!='S') && (ibmail.lines[cnt][0]!='/' && ibmail.lines[cnt][1]!='A') && cnt<9);
  4218.  
  4219.           if (ibmail.lines[cnt][1]=='s' || ibmail.lines[cnt][1]=='S' || cnt==9) {
  4220.             ny_line(135,0,1);
  4221. //                od_printf("\b\b`bright red`S`red`aving...\n\r");
  4222.             //cnt+=mail_idx.afterquote;
  4223.             ibmail.length=cnt;
  4224.             strcpy(ibmail.recver,ibscr_rec.name);
  4225.             strcpy(ibmail.sender,cur_user.name);
  4226.             strcpy(ibmail.node_r,IBBSInfo.paOtherSystem[intval].szAddress);
  4227.             strcpy(ibmail.node_s,IBBSInfo.szThisNodeAddress);
  4228.             strcpy(ibmail.recverI,ibscr_rec.nameI);
  4229.             strcpy(ibmail.senderI,cur_user.bbsname);
  4230.             ibmail.deleted=FALSE;
  4231.             ibmail.sender_sex=cur_user.sex;
  4232.             ibmail.ill=cur_user.std;
  4233.             ibmail.inf=cur_user.std_percent;
  4234.             sprintf(IBBSInfo.szProgName, "#@NYG#%05d MAIL",ibbs_game_num);
  4235.  
  4236.             IBSendMail(&IBBSInfo,&ibmail);
  4237.  
  4238.             //IBSend(&IBBSInfo,IBBSInfo.paOtherSystem[intval].szAddress,&ibmail,sizeof(ibbs_mail_type)-((20-ibmail.length)*81));
  4239.  
  4240.  
  4241.           } else {
  4242.             ny_line(136,0,1);
  4243.             cur_user.sex_today++;
  4244.           }
  4245.  
  4246.           if(!rip)
  4247.             WaitForEnter();
  4248.           else
  4249.             od_get_answer("\n\r");
  4250.         } else if (cur_user.sex_today<=0) {
  4251.  
  4252.           ny_line(118,1,1);
  4253.           //od_printf("\n\r\n\r`bright`You already used up all your sex turns today ...\n\r");
  4254.  
  4255.           WaitForEnter();
  4256.           od_printf("\n\r");
  4257.         }
  4258.           }
  4259.         }
  4260.       } else if (key=='M') {
  4261.         if(cur_user.InterBBSMoves<=0) {
  4262.           ny_line(455,2,1);
  4263.           if(rip) {
  4264.            od_get_answer("\n\r");
  4265.            no_rip_m=1;
  4266.           } else
  4267.         WaitForEnter();
  4268.         } else {
  4269.           intval=ibbs_bbs_list();
  4270.           if(intval>-1) {
  4271.         ibbs_bbs_name(intval,0,FALSE,hand,&dbn,&pn);
  4272.         if(hand[0]!=0) {
  4273.           cur_user.InterBBSMoves--;
  4274.           sprintf(numstr,"NYSPYDB.%03d",dbn);
  4275.           justfile=ShareFileOpen(numstr,"rb");
  4276.           fseek(justfile,pn*sizeof(ibbs_scr_rec),SEEK_SET);
  4277.           ny_fread(&ibscr_rec,sizeof(ibbs_scr_rec),1,justfile);
  4278.           fclose(justfile);
  4279.  
  4280.           ibmail.flirt=1002;
  4281.           ibmail.quote_length=0;
  4282.  
  4283.           if(rip) {
  4284.             od_send_file("input.rip");
  4285.             od_disp_str("\n\r");
  4286.           }
  4287.           ny_line(417,0,0);
  4288.           od_printf(D_Num(cur_user.money));
  4289.           ny_disp_emu("`2):");
  4290.           money=get_val((unsigned long)0,cur_user.money);
  4291.  
  4292.           *(unsigned long *)ibmail.lines[0]=money;
  4293.  
  4294.           if(money!=0) {
  4295.  
  4296.             ny_line(135,1,1);
  4297. //                od_printf("\b\b`bright red`S`red`aving...\n\r");
  4298.             //cnt+=mail_idx.afterquote;
  4299.             ibmail.length=1;
  4300.             strcpy(ibmail.recver,ibscr_rec.name);
  4301.             strcpy(ibmail.sender,cur_user.name);
  4302.             strcpy(ibmail.node_r,IBBSInfo.paOtherSystem[intval].szAddress);
  4303.             strcpy(ibmail.node_s,IBBSInfo.szThisNodeAddress);
  4304.             strcpy(ibmail.recverI,ibscr_rec.nameI);
  4305.             strcpy(ibmail.senderI,cur_user.bbsname);
  4306.             ibmail.deleted=FALSE;
  4307.             ibmail.sender_sex=cur_user.sex;
  4308.             ibmail.ill=cur_user.std;
  4309.             ibmail.inf=cur_user.std_percent;
  4310.             sprintf(IBBSInfo.szProgName, "#@NYG#%05d MAIL",ibbs_game_num);
  4311.  
  4312.             IBSendMail(&IBBSInfo,&ibmail);
  4313.  
  4314.             //IBSend(&IBBSInfo,IBBSInfo.paOtherSystem[intval].szAddress,&ibmail,sizeof(ibbs_mail_type)-((20-ibmail.length)*81));
  4315.  
  4316.             if(!rip)
  4317.               WaitForEnter();
  4318.             else
  4319.               od_get_answer("\n\r");
  4320.           } else {
  4321.             cur_user.InterBBSMoves++;
  4322.           }
  4323.         }
  4324.           }
  4325.         }
  4326.       } else if (key=='A') {
  4327.  
  4328.         if(rip) od_send_file("texti.rip");
  4329.         ny_line(309,2,1);
  4330.         //Say what:
  4331.         ny_line(310,0,1);
  4332.         //|-----------------------------------------------------------------------------|
  4333.  
  4334.         od_input_str(line,79,' ',255);
  4335.         if(line[0]!=0) {
  4336.           if(dobad)
  4337.         dobadwords(line);
  4338.           news_post(line,cur_user.name,"",1);
  4339.           strcpy(newzfile.tagline,line);
  4340.           strcpy(newzfile.name,cur_user.name);
  4341.           strncpy(newzfile.name2,LocationOf(IBBSInfo.szThisNodeAddress),35);
  4342.           newzfile.name2[35]=0;
  4343.           newzfile.flag=6;
  4344.           sprintf(IBBSInfo.szProgName, "#@NYG#%05d NEWS",ibbs_game_num);
  4345.           IBSendAll(&IBBSInfo,(char *)&newzfile,sizeof(newzfile));
  4346.           ny_line(311,2,1);
  4347.           //Posted...
  4348.           if(!rip)
  4349.         WaitForEnter();
  4350.           else
  4351.         od_get_answer("\n\r");
  4352.         }
  4353.       } else if (key=='B') {
  4354.         if(cur_user.InterBBSMoves<=0) {
  4355.           ny_line(455,2,1);
  4356.           if(rip) {
  4357.         od_get_answer("\n\r");
  4358.         no_rip_m=1;
  4359.           } else
  4360.         WaitForEnter();
  4361.         } else {
  4362.           money=15 + (15*pow(1.7,(double)cur_user.level));
  4363.           ny_line(467,2,0);
  4364.           od_printf("%s",D_Num(money));
  4365.           ny_line(468,0,0);
  4366.           key=ny_get_answer("YN");
  4367.           if(key=='Y') {
  4368.         if(money>cur_user.money) {
  4369.           ny_line(252,2,1);
  4370.           if(!rip)
  4371.             WaitForEnter();
  4372.           else
  4373.             od_get_answer("\n\r");
  4374.         } else {
  4375.           intval=ibbs_bbs_list();
  4376.           if(intval>-1) {
  4377.             ibbs_bbs_name(intval,0,FALSE,hand,&dbn,&pn);
  4378.             if(hand[0]!=0) {
  4379.               cur_user.InterBBSMoves--;
  4380.               money_minus(money);
  4381.               sprintf(numstr,"NYSPYDB.%03d",dbn);
  4382.               justfile=ShareFileOpen(numstr,"rb");
  4383.               fseek(justfile,pn*sizeof(ibbs_scr_rec),SEEK_SET);
  4384.               ny_fread(&ibscr_rec,sizeof(ibbs_scr_rec),1,justfile);
  4385.               fclose(justfile);
  4386.  
  4387.               ibmail.flirt=1005;
  4388.               ibmail.quote_length=0;
  4389.  
  4390.               ny_line(135,0,1);
  4391. //                  od_printf("\b\b`bright red`S`red`aving...\n\r");
  4392.               //cnt+=mail_idx.afterquote;
  4393.               ibmail.length=1;
  4394.               strcpy(ibmail.recver,ibscr_rec.name);
  4395.               strcpy(ibmail.sender,cur_user.name);
  4396.               strcpy(ibmail.node_r,IBBSInfo.paOtherSystem[intval].szAddress);
  4397.               strcpy(ibmail.node_s,IBBSInfo.szThisNodeAddress);
  4398.               strcpy(ibmail.recverI,ibscr_rec.nameI);
  4399.               strcpy(ibmail.senderI,cur_user.bbsname);
  4400.               ibmail.deleted=FALSE;
  4401.               ibmail.sender_sex=cur_user.sex;
  4402.               ibmail.ill=cur_user.std;
  4403.               ibmail.inf=cur_user.std_percent;
  4404.               sprintf(IBBSInfo.szProgName, "#@NYG#%05d MAIL",ibbs_game_num);
  4405.  
  4406.               IBSendMail(&IBBSInfo,&ibmail);
  4407.  
  4408.               //IBSend(&IBBSInfo,IBBSInfo.paOtherSystem[intval].szAddress,&ibmail,sizeof(ibbs_mail_type)-((20-ibmail.length)*81));
  4409.  
  4410.               if(!rip)
  4411.             WaitForEnter();
  4412.               else
  4413.             od_get_answer("\n\r");
  4414.             }
  4415.           }
  4416.         }
  4417.           }
  4418.         }
  4419.       } else if (key=='H') {
  4420.         if(cur_user.InterBBSMoves<=0) {
  4421.           ny_line(455,2,1);
  4422.           if(rip) {
  4423.         od_get_answer("\n\r");
  4424.         no_rip_m=1;
  4425.           } else
  4426.         WaitForEnter();
  4427.         } else {
  4428.  
  4429.           od_disp_str("\n\n\r");
  4430.  
  4431.           if(!rip)
  4432.         ny_send_menu(HITMEN,"");
  4433.  
  4434.           ny_line(470,0,0);
  4435.  
  4436.           no_kernel=TRUE;
  4437.           key=ny_get_answer("123456Q");
  4438.           no_kernel=FALSE;
  4439.           if(key!='Q') {
  4440.         intval=key-'1'+1;
  4441.         money=(15 + (15*pow(1.7,(double)cur_user.level))) * intval;
  4442.         ny_line(469,2,0);
  4443.         od_printf("%s",D_Num(money));
  4444.         ny_line(468,0,0);
  4445.         key=ny_get_answer("YN");
  4446.           }
  4447.           if(key=='Y') {
  4448.         if(money>cur_user.money) {
  4449.           ny_line(252,2,1);
  4450.           if(!rip)
  4451.             WaitForEnter();
  4452.           else
  4453.             od_get_answer("\n\r");
  4454.         } else {
  4455.           *(int *)ibmail.lines[0]=intval-1;
  4456.           if(intval==1) strcpy(ibmail.lines[1],"George");
  4457.           else if(intval==2) strcpy(ibmail.lines[1],"Gang Member");
  4458.           else if(intval==3) strcpy(ibmail.lines[1],"Mafia Guy");
  4459.           else if(intval==4) strcpy(ibmail.lines[1],"Lloyd The Bloody");
  4460.           else if(intval==5) strcpy(ibmail.lines[1],"David Koresh");
  4461.           else if(intval==6) strcpy(ibmail.lines[1],"Masked Fella");
  4462.           intval=ibbs_bbs_list();
  4463.           if(intval>-1) {
  4464.             ibbs_bbs_name(intval,0,FALSE,hand,&dbn,&pn);
  4465.             if(hand[0]!=0) {
  4466.               cur_user.InterBBSMoves--;
  4467.               money_minus(money);
  4468.               sprintf(numstr,"NYSPYDB.%03d",dbn);
  4469.               justfile=ShareFileOpen(numstr,"rb");
  4470.               fseek(justfile,pn*sizeof(ibbs_scr_rec),SEEK_SET);
  4471.               ny_fread(&ibscr_rec,sizeof(ibbs_scr_rec),1,justfile);
  4472.               fclose(justfile);
  4473.  
  4474.               ibmail.flirt=1004;
  4475.               ibmail.quote_length=0;
  4476.  
  4477.               ny_line(135,2,1);
  4478. //                  od_printf("\b\b`bright red`S`red`aving...\n\r");
  4479.               //cnt+=mail_idx.afterquote;
  4480.               ibmail.length=2;
  4481.               strcpy(ibmail.recver,ibscr_rec.name);
  4482.               strcpy(ibmail.sender,cur_user.name);
  4483.               strcpy(ibmail.node_r,IBBSInfo.paOtherSystem[intval].szAddress);
  4484.               strcpy(ibmail.node_s,IBBSInfo.szThisNodeAddress);
  4485.               strcpy(ibmail.recverI,ibscr_rec.nameI);
  4486.               strcpy(ibmail.senderI,cur_user.bbsname);
  4487.               ibmail.deleted=FALSE;
  4488.               ibmail.sender_sex=cur_user.sex;
  4489.               ibmail.ill=cur_user.std;
  4490.               ibmail.inf=cur_user.std_percent;
  4491.               sprintf(IBBSInfo.szProgName, "#@NYG#%05d MAIL",ibbs_game_num);
  4492.  
  4493.               IBSendMail(&IBBSInfo,&ibmail);
  4494.  
  4495.               //IBSend(&IBBSInfo,IBBSInfo.paOtherSystem[intval].szAddress,&ibmail,sizeof(ibbs_mail_type)-((20-ibmail.length)*81));
  4496.  
  4497.               if(!rip)
  4498.             WaitForEnter();
  4499.               else
  4500.             od_get_answer("\n\r");
  4501.             }
  4502.           }
  4503.         }
  4504.           }
  4505.         }
  4506.       } else if (key=='I') {
  4507.         if(cur_user.InterBBSMoves<=0) {
  4508.           ny_line(455,2,1);
  4509.           if(rip) {
  4510.         od_get_answer("\n\r");
  4511.         no_rip_m=1;
  4512.           } else
  4513.         WaitForEnter();
  4514.         } else {
  4515.           money=15 + (15*pow(1.7,(double)cur_user.level));
  4516.           ny_line(471,2,0);
  4517.           od_printf("%s",D_Num(money));
  4518.           ny_line(468,0,0);
  4519.           key=ny_get_answer("YN");
  4520.           if(key=='Y') {
  4521.         if(money>cur_user.money) {
  4522.           ny_line(252,2,1);
  4523.           if(!rip)
  4524.             WaitForEnter();
  4525.           else
  4526.             od_get_answer("\n\r");
  4527.         } else {
  4528.           intval=ibbs_bbs_list();
  4529.           if(intval>-1) {
  4530.             ibbs_bbs_name(intval,0,FALSE,hand,&dbn,&pn);
  4531.             if(hand[0]!=0) {
  4532.               cur_user.InterBBSMoves--;
  4533.               money_minus(money);
  4534.               sprintf(numstr,"NYSPYDB.%03d",dbn);
  4535.               justfile=ShareFileOpen(numstr,"rb");
  4536.               fseek(justfile,pn*sizeof(ibbs_scr_rec),SEEK_SET);
  4537.               ny_fread(&ibscr_rec,sizeof(ibbs_scr_rec),1,justfile);
  4538.               fclose(justfile);
  4539.  
  4540.               ibmail.flirt=1003;
  4541.               ibmail.quote_length=0;
  4542.  
  4543.               ny_line(135,2,1);
  4544. //                  od_printf("\b\b`bright red`S`red`aving...\n\r");
  4545.               //cnt+=mail_idx.afterquote;
  4546.               ibmail.length=1;
  4547.               strcpy(ibmail.recver,ibscr_rec.name);
  4548.               strcpy(ibmail.sender,cur_user.name);
  4549.               strcpy(ibmail.node_r,IBBSInfo.paOtherSystem[intval].szAddress);
  4550.               strcpy(ibmail.node_s,IBBSInfo.szThisNodeAddress);
  4551.               strcpy(ibmail.recverI,ibscr_rec.nameI);
  4552.               strcpy(ibmail.senderI,cur_user.bbsname);
  4553.               ibmail.deleted=FALSE;
  4554.               ibmail.sender_sex=cur_user.sex;
  4555.               ibmail.ill=(desease)(random((int)AIDS)+1);
  4556.               ibmail.inf=random(10)+2;
  4557.               sprintf(IBBSInfo.szProgName, "#@NYG#%05d MAIL",ibbs_game_num);
  4558.  
  4559.               IBSendMail(&IBBSInfo,&ibmail);
  4560.  
  4561.               //IBSend(&IBBSInfo,IBBSInfo.paOtherSystem[intval].szAddress,&ibmail,sizeof(ibbs_mail_type)-((20-ibmail.length)*81));
  4562.  
  4563.               if(!rip)
  4564.             WaitForEnter();
  4565.               else
  4566.             od_get_answer("\n\r");
  4567.             }
  4568.           }
  4569.         }
  4570.           }
  4571.         }
  4572.       } else if (key=='D') {
  4573.         intval=ibbs_bbs_list();
  4574.         if(intval>-1) {
  4575.           ibbs_bbs_name(intval,0,TRUE,hand,&dbn,&pn);
  4576.         }
  4577.       }
  4578.     } while (key!='Q');
  4579. }
  4580.